guinness

DirToHTML5 - Create a HTML5 and CSS3 only directory structure without JavaScript.

17 posts in this topic

#1 ·  Posted (edited)

Never say I don't give this community some little gems once in a while. I came up with the concept of creating a directory structure using nothing but valid HTML5 and CSS3. It uses an unknown "checkbox hack" concept which some HTML5/CSS3 purists consider to be beyond the semantics of the language. But I say if it's supported by all major browsers and it works, then why not!

Note: I used >KaFu's idea for the current level and next level, but the rest I came up with myself, albeit I have used this "checkbox hack" before in other projects I have created. 

#include <File.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>

MsgBox($MB_SYSTEMMODAL, '', 'This example only uses HTML5 and CSS3, I know, no JavaScript!')

; Thanks to KaFu for the idea: http://www.autoitscript.com/forum/topic/156913-dir2html-create-html-site-with-links-from-a-dir-structure/?p=1136522
Example()

Func Example()
    Local Const $sSaveFilePath = @ScriptDir
    Local $sHTML = '', $sTab = @TAB
    _HTML_Add($sHTML, '<!DOCTYPE html>')
    _HTML_Add($sHTML, '<html lang="en">')
    _HTML_Add($sHTML, '<head>')
    _HTML_Add($sHTML, '<meta charset="utf-8">', $sTab)
    _HTML_Add($sHTML, '<title>Directory To HTML5 Concept</title>', $sTab)
    _HTML_Add($sHTML, '<style type="text/css">', $sTab)
    _Tab_Add($sTab)
    _HTML_Add($sHTML, '@import url(http://weloveiconfonts.com/api/?family=fontawesome);.dirtohtml a{background:transparent;color:#08c;position:relative;text-decoration:none;-webkit-transition:all .3s ease-out;transition:all .3s ease-out}.dirtohtml a:hover{color:#0af}.dirtohtml input[type=checkbox],.dirtohtml input[type=checkbox]+ul{display:none}.dirtohtml input[type=checkbox]:checked+ul{display:block}.dirtohtml label{cursor:pointer}.dirtohtml ul li{list-style:none}[class*="fontawesome-"]:before{font-family:"FontAwesome",sans-serif;margin-right:5px}', $sTab)
    _Tab_Remove($sTab)
    _HTML_Add($sHTML, '</style>', $sTab)
    _Tab_Remove($sTab)
    _HTML_Add($sHTML, '</head>')
    _HTML_Add($sHTML, '<body>')
    _Tab_Add($sTab)

    Local Const $sDirectorySelection = FileSelectFolder('Select a folder to map to HTML', '')
    Local $aFileList = _FileListToArrayRec($sDirectorySelection, '*', 0, 1, 2, 2)
    If @error Then
        _HTML_Add($sHTML, '<p>No files were present in the selected directory.</p>', $sTab)
    Else
        _HTML_Add($sHTML, '<div class="dirtohtml">', $sTab)
        _Tab_Add($sTab)
        _HTML_Add($sHTML, '<ul>', $sTab)
        _Tab_Add($sTab)
        Local $bIsRelative = False, _
                $iCheckboxCount = 1, $iCurrentLevel = 0, $iNestedDepth = 0, $iNextIndex = 0, $iNextLevel = 0, _
                $sFileName = '', $sRelativeFilePath = ''
        For $i = 1 To $aFileList[0]
            $aFileList[$i] = StringRegExpReplace($aFileList[$i], '(?:\\|/)', '\\')
            $iCurrentLevel = @extended

            If $i < $aFileList[0] Then
                $iNextIndex = $i + 1
                $aFileList[$iNextIndex] = StringRegExpReplace($aFileList[$iNextIndex], '(?:\\|/)', '\\')
                $iNextLevel = @extended
            EndIf

            $sFileName = StringRegExpReplace($aFileList[$i], '^.+\\', '')
            If _WinAPI_PathIsDirectory($aFileList[$i]) = $FILE_ATTRIBUTE_DIRECTORY Then
                If $iNextLevel > $iCurrentLevel Or $iNextLevel = $iCurrentLevel Then
                    _HTML_Add($sHTML, '<li>', $sTab)
                    _Tab_Add($sTab)
                    _HTML_Add($sHTML, '<label for="dirtohtml_' & $iCheckboxCount & '"><i class="fontawesome-folder-close-alt"></i>' & $sFileName & '</label>', $sTab)
                    _HTML_Add($sHTML, '<input id="dirtohtml_' & $iCheckboxCount & '" type="checkbox">', $sTab)
                    _HTML_Add($sHTML, '<ul>', $sTab)
                    $iCheckboxCount += 1
                    $iNestedDepth += 1
                ElseIf $iNextLevel < $iCurrentLevel Then
                    _HTML_Add($sHTML, '<li>' & $sFileName, $sTab)
                EndIf
                _Tab_Add($sTab)
            Else
                $sRelativeFilePath = _PathGetRelative($sSaveFilePath, $aFileList[$i])
                $bIsRelative = Not @error
                _HTML_Add($sHTML, '<li><i class="fontawesome-file"></i><a href="' & ($bIsRelative ? '' : 'file://') & StringReplace($sRelativeFilePath, '\', '/') & '">' & $sFileName & '</a></li>', $sTab)
                If $iNextLevel < $iCurrentLevel Then
                    For $j = 1 To ($iCurrentLevel - $iNextLevel)
                        _Tab_Remove($sTab)
                        _HTML_Add($sHTML, '</ul>', $sTab)
                        _Tab_Remove($sTab)
                        _HTML_Add($sHTML, '</li>', $sTab)
                        $iNestedDepth -= 1
                    Next
                EndIf
            EndIf
        Next

        If $iNestedDepth Then
            For $j = 1 To $iNestedDepth
                _Tab_Remove($sTab)
                _HTML_Add($sHTML, '</ul>', $sTab)
                _Tab_Remove($sTab)
                _HTML_Add($sHTML, '</li>', $sTab)
            Next
        EndIf
        _Tab_Remove($sTab)
        _HTML_Add($sHTML, '</ul>', $sTab)
        _Tab_Remove($sTab)
        _HTML_Add($sHTML, '</div>', $sTab)
    EndIf

    _HTML_Add($sHTML, '</body>')
    _HTML_Add($sHTML, '</html>')

    Local Const $sHTMLFilePath = _WinAPI_PathRemoveBackslash($sSaveFilePath) & '\index.html'
    Local Const $hFileOpen = FileOpen($sHTMLFilePath, BitOR($FO_OVERWRITE, $FO_UTF8))
    If $hFileOpen > -1 Then
        FileWrite($hFileOpen, $sHTML)
        FileClose($hFileOpen)
        MsgBox($MB_SYSTEMMODAL, '', 'HTML file created successfully.' & @CRLF & $sHTMLFilePath)
    Else
        MsgBox($MB_SYSTEMMODAL, '', 'An error occurred writing to the HTML file.')
    EndIf
    ConsoleWrite($sHTML & @CRLF)
    ; ShellExecute($sHTMLFilePath)
    Return True
EndFunc   ;==>Example

Func _HTML_Add(ByRef $sHTML, $sData, $sTab = Default)
    $sHTML &= (($sTab = Default) ? '' : $sTab) & $sData & @CRLF
EndFunc   ;==>_HTML_Add

Func _Tab_Add(ByRef $sTab)
    $sTab &= @TAB
EndFunc   ;==>_Tab_Add

Func _Tab_Remove(ByRef $sTab)
    Local Static $TAB_LENGTH = StringLen(@TAB)
    $sTab = StringTrimRight($sTab, $TAB_LENGTH)
EndFunc   ;==>_Tab_Remove
Edited by guinness
3 people like this

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites



Changed the a links styling.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Nice scirpt.

But I notice there is an issue with Polish language in file names.

Look in attached example.

there is:

Dla programist�w - SerwerSMS.pl - Jasna strona komunikacji.htm

instead

Dla programistów - SerwerSMS.pl - Jasna strona komunikacji.htm

index.html


ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Ha, I was just issuing a fix for that. See first post.

Edit: The reason I didn't encode the file before was this was a proof of concept only.

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

[#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7

look at first char ;)

EDIT:

ignoring this fact, it works now

Edited by mLipok

ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-12-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

Fixed.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Just updated the example, though no bug fixes (as I haven't found any.)


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I added @error checking for _FileListToArrayRec() which will print out no files were found if no files were found.

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Just a minor syntax fix.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Nice script guiness, very creative use of the selector, and thanks for sharing.  This 'hack' is a well known css selector (:checked) and is apart of the HTML5 standard.  You could have combined your two elements into one to make less HTML like this:

<head>

<style>

.fontawesome-file{

color: blue;

font-style: italic;

cursor: pointer;

}

.fontawesome-file:hover{

color: #0af;

}

<style>

</head>

<div class="fontawesome-file" href="guinesstest.au3">guinesstest.au3</div>
 
Also, the subdirectory names, having the name 'out there' is not good practice because you would have to have tricky/extra javascript code to change the 'subdir' name (if in the future you decided to) without changing the rest of the innerHTML.  It would be better to include it inside a div tag, or apart of some value="xx".
 
Edit:
 
err... I mean, having the <i> tag inside a <label>, the 'subdir' inside <label> is fine.
Edited by TouchOdeath

Share this post


Link to post
Share on other sites

Thanks. I hope you don't mind but I have a couple of responses to your post.

1. If the user decided to change the sub-directory name then I would expect them to re-run this script again to generate a new HTML file, though I guess I could have put it in a date-* attribute.

2. As for your code suggestion, I am pretty sure using the href attribute in a div element is invalid. Also didn't want to use a class name that I have no control over, as I linking externally to it.

3. Oh, and about the css hack comment, I meant that using the :checked pseudo selector in this way is what some "css purists" would call a hack.

Cheers for looking at the coding.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

By all means, we are all here to improve one another.  I need to look at others code more often for sure.

#2 you are correct on this, you could change the <div> to an <a>, and replace the <style> with this:

<style>

.fontawesome-file::before{font-style: italic;/*to keep close to the same look*/

<style>

 

Thanks for letting me know.

 

#3 I guess I miss understood that part, but regardless it does have a nice "how the hell?" feel to it, even if you are a css purist.

Again big thanks for sharing and commenting back.

Edited by TouchOdeath

Share this post


Link to post
Share on other sites

Okay thanks. You're also welcome, as I believe sharing is caring!

1 person likes this

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Hi guinness, interesting Topic

In some cases, directories arborescence is not respected.

For test, I reproduce the problem with this archive Nouveau dossier 1.7z

 

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Thanks. This was just a proof of concept, so you will have to debug yourself. Good luck.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

It does not matter
Problem comes from Dir2HTML by Kafu on which you take the "levels" idea.
Fortunately Dir2HTML by Xenobiologist is fully functional !

 


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Great to hear.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • AmarokStudios
      By AmarokStudios
      Good afternoon AutoIt community!,
      I was on Stackoverflow the other day and came across this question: How To Include Files From A Directory. This got me thinking... There has to be a way to do it... After a bunch of research, I wasn't able to find anything. So, I created this UDF to dynamically include every file from the directory. Of course, there are some bugs that I'd like to fix eventually, but for the most part, it works. Simply call the main function (Shown below) right after the rest of the includes before any of your actual code, and the UDF will include all of the au3 files in the specified directory. Without further ado, here is the _includeDir UDF and how to use it!
       
      _includeDir.au3
       
      Download this code (_includeDir.au3 attached as well) and place it into the directory with your current script. Next, include it in your main file. For now, I'm going to be using one called Example.au3.
       
      #Include "_includeDir.au3" Now, include whatever else you're going to be including in this script, then call the _includeDir function. NOTE: THIS MUST BE CALLED AT THE TOP OF THE SCRIPT, BEFORE ANY CODE IS WRITTEN! THE FUNCTION FORCES THE SCRIPT TO RESTART SO PUTTING IT LATER IN THE SCRIPT WILL RE-RUN THE CODE!
       
      Example.au3
      #Include "_includeDir.au3" #Include <File.au3> ; Not needed. Just here as an example of a normal script. #Include <Array.au3> ; Not needed. Just here as example of normal script. _includeDir("Directory to Include") MsgBox(0,"Example","This is just an example!") See how the function is called near the top? This is the proper use of the UDF. If you had a folder called "Directory to Include" and had a bunch of .au3 files inside of it, the function would include them all into the Example.au3 script.
      If you run the Example.au3 file now, it will most likely tell you "The directory Things to Include does not exist!". Make sure you enter the name of the directory you're trying to include. Just as a side note, when including files, you should put all of the code in the INCLUDED files inside of functions so they aren't automatically run when included. Variables can be outside of the functions so they are automatically set. Remember, if you have a variable in one included file with the same name of variable in another included file, it will be overwritten with whichever include file was included last.
       
      Anyways, if you have pointed the directory to include parameter to a folder that exists and run the Example.au3, it will generate a folder called IncludeDirUDF. It will also write a new line inside of Example.au3. It will write the line 
      on line one. Of course, you don't always want it to be written to line one, right? Maybe you want this bit of code to be written on line 3 in order to keep your code organize. Is there a way to do this? Absolutely! Simply add the line number as a second parameter to the function. For example, we want to have this bit of code written on line 3, we would set up our Example.au3 file to look like this.
      #Include "_includeDir.au3" #Include <File.au3> ; Not needed. Just here as an example of a normal script. #Include <Array.au3> ; Not needed. Just here as example of normal script. _includeDir("Directory to Include", 3) MsgBox(0,"Example","This is just an example!") See how we added the 3 to the end of _includeDir? This will tell the function to write the #Include "IncludeDirUDF\loadIncludes.au3" on line 3 of Example.au3. Note, the line HAS TO EXIST in order to be written to it. For example, if your Example.au3 code only has 6 lines, and you specify to be written on line 7, it WILL NOT WORK.
       
      The code is designed to include and restart in order to process the included files. For some reason, if you want to JUST generate the included file and NOT restart, you can add one more parameter to the code. If you don't want the code to restart, simply set your code up to look like this:
      #Include "_includeDir.au3" #Include <File.au3> ; Not needed. Just here as an example of a normal script. #Include <Array.au3> ; Not needed. Just here as example of normal script. _includeDir("Directory to Include", 3, False) MsgBox(0,"Example","This is just an example!") Note, if you set this last parameter to false, it will simply generate the included file and write to line 3 of Example.au3 (As specified before) and exit before the code reaches the MsgBox() and it will not be displayed.
       
      The last important thing to note: In order to re-include a different set of files, you must delete the #Include "IncludeDirUDF\loadIncludes.au3" from your main script (In this case, Example.au3) and delete the generated file, IncludeDirUDF. Now you can simply rerun Example.au3 and it will include any the dir with any changes you made to it. Only .au3 files should be in the directory you're trying to include as it will not process the other files and will generate an error.
       
      I hope this UDF helps somebody out! Comment any questions/concerns you may have and I will try to address them as soon as possible!
       
      Thanks,
      Timothy
      CEO - Amarok Studios
      _includeDir.au3
    • Reizvoller
      By Reizvoller
      Greetings!
      I am having an issue that I can't seem to be able to figure out. I would really appreciate an extra pair of eyes to validate my work so far.
      All this is, so far, is just a bunch of shapes on an HTML page. It is to be a very simple game ( just exploring Javascript through making this ) but right now I am just building the framework/elements.
      The script is this 
      <!DOCTYPE HTML> <html> <head> <style> body { margin: 0px; padding: 0px; } #canvas-container { width: 100%; text-align:center; } canvas { display: inline; } </style> </head> <body onload="startUp()"> <div id="canvas-container"> <canvas id="game" width="300" height="500"></canvas> </div> <script> var canvas = document.getElementById('game'); var ctx = canvas.getContext('2d'); var x = canvas.width; var y = canvas.height; var scoreVal = 0; var itemXRand = Math.floor(Math.random() * x) + 1 ctx.stroke(); function cloud(){ ctx.beginPath(); ctx.moveTo(170, 30); ctx.bezierCurveTo(130, 100, 130, 150, 230, 150); ctx.bezierCurveTo(250, 180, 320, 180, 340, 150); ctx.bezierCurveTo(420, 150, 420, 120, 390, 100); ctx.bezierCurveTo(430, 40, 370, 30, 340, 50); ctx.bezierCurveTo(320, 5, 250, 20, 250, 50); ctx.bezierCurveTo(200, 5, 150, 20, 170, 80); ctx.closePath(); ctx.lineWidth = 5; ctx.fillStyle = '#8ED6FF'; ctx.fill(); ctx.strokeStyle = '#0000ff'; ctx.stroke(); } function workArea(){ ctx.beginPath(); ctx.rect(0, 0, x, y); ctx.fillStyle = "#2ab9ff"; ctx.fill(); ctx.stroke = 1; } function topRect(){ ctx.beginPath(); ctx.rect(0, 0, x, 30); ctx.fillStyle = "#D3D3D3"; ctx.fill(); ctx.stroke = 1; } function scoreKeep(){ ctx.font = "15px Arial"; ctx.fillStyle = "#000000"; ctx.fillText("Score "+scoreVal,5, 25); } function bttmRect(){ ctx.beginPath(); ctx.rect(0, y-30, x, 30); ctx.fillStyle = '#5bc928'; ctx.fill(); ctx.stroke = 1; } function monstRect(){ ctx.beginPath(); ctx.rect(0, y-80, x, 30); ctx.fillStyle = 'red'; ctx.fill(); ctx.stroke = 1; } function itemCirc(){ var centerX = itemXRand var radius = 15; var positionY = 45; ctx.beginPath(); ctx.arc(centerX, positionY, radius, 0, 2 * Math.PI, false); ctx.fillStyle = randomColor(); ctx.fill(); ctx.lineWidth = 1; ctx.strokeStyle = '#003300'; ctx.stroke(); } function startUp(){ workArea(); topRect(); bttmRect(); scoreKeep(); itemCirc(); monstRect(); cloud(); } function randomColor(){ return('#'+Math.floor(Math.random()*16777215).toString(16)); } </script> </body> </html> The issue is that cloud() and monstRect() will not show up when the page loads. If I comment out workArea(), topRect(), and bttmRect() in the function "startUp()" then monstRect() and cloud() show up. I've re-read those little snippets of code for those three areas that I comment out and I can't see where I have gone wrong.
      Any advice or if you can spot my mistake I would really appreciate it.
      Thank you!
      -Reiz
    • digitalexpl0it
      By digitalexpl0it
      Hello,
      I am trying to look into multiple folders for outlook OST's. What I need is if there are more than one, delete the oldest one in that directory then move to the next directory. I am not to sure on how to compare and detect multiple OSTs in a folder. So far my script will search all the subdirectories in a given path and prompt me with the OST's found. How to I check for more than one OST and delete the oldest?
      Folder structure example:
      OSTS
      - user1
        - User1.ost
      - User2
        - User2.ost
        -User2_dup.ost
      Etc...
       
      ; Script Start - Add your code below here #include <Array.au3> ; Only required to display the arrays #include <File.au3> #include <MsgBoxConstants.au3> Local $sOSTDir = "\\server1\osts\" $aArray = _FileListToArrayRec($sOSTDir, "*.ost", $FLTAR_RECUR, $FLTAR_SORT) for $i = 1 to $aArray[0] $time = FileGetTime($sOSTDir & $aArray[$i], 2); 0 if for modified date $dmyyyy = $time[3]& ":" & $time[4] & ":" & $time[5]&'_'&$time[1]& "/" & $time[2] & "/" & $time[0] msgbox(0,"test", $aArray[$i] & " | Date: " & $dmyyyy) next Any help would be appreciated. 
    • zelles
      By zelles
      Using the FTP FTPEx.au3 makes communicating with FTP a breeze. With great functions like _FTP_FileGet, _FTP_FilePut, and _FTP_DirPutContents, you can upload and download with ease. But what about the much needed ability to download a folder with a simple _FTP_DirGetContents function? Well I put together a function that will download a folder with ease...
      _FTP_DirGetContents Function:
      Func _FTP_DirGetContents($oConn, $opath, $olocal, $orec) If Not FileExists($olocal) Then DirCreate($olocal) If StringRight($opath, 1) <> "/" Then $opath &= "/" If $orec == 1 Then Local $ocurrent = _FTP_DirGetCurrent($oConn) _FTP_DirSetCurrent($oConn, $opath) Local $afolders = _FTP_ListToArray($oConn, 1) _FTP_DirSetCurrent($oConn, $ocurrent) For $o = 1 To $afolders[0] If $afolders[$o] == "." Or $afolders[$o] == ".." Then ContinueLoop If Not FileExists($olocal & "\" & $afolders[$o]) Then DirCreate($olocal & "\" & $afolders[$o]) _FTP_DirGetContents($oConn, $opath & $afolders[$o], $olocal & "\" & $afolders[$o], $orec) Next EndIf Local $hFTPFind Local $aFile = _FTP_FindFileFirst($oConn, $opath, $hFTPFind) While 1 _FTP_FileGet($oConn, $opath & $aFile[10], @ScriptDir & "\tmpdata\" & $aFile[10]) $aFile = _FTP_FindFileNext($hFTPFind) If @error Then ExitLoop WEnd _FTP_FindFileClose($hFTPFind) EndFunc Example Usage:
      #include <FTPEx.au3> If Not FileExist(@ScriptDir & "\ftptemp") Then DirCreate(@ScriptDir & "\ftptemp") $dir_local = @ScriptDir & "\ftptemp" $dir_remote = "/" Local $iOpen = _FTP_Open('MyFTP Control') Local $iConn = _FTP_Connect($iOpen, "YourFTPServer", "YourUsername", "YourPassword") _FTP_DirGetContents($iConn, $dir_remote, $dir_local, 1) _FTP_Close($iConn) _FTP_Close($iOpen) Function Call Explanation:
      _FTP_DirGetContents($oConn, $opath, $olocal, $orec)
      $oConn: session handle as returned by _FTP_Connect. $opath: The remote folder to download $olocal: The local folder to download to. $orec: set to 1 to download folder and subfolders. Set to 0 for non recursive. Enjoy
    • Ascend4nt
      By Ascend4nt
      IE Embedded Control Versioning
      Use IE 9+ and HTML5 features inside a GUI

      This UDF allows the use of embedded IE controls which support IE versions greater than IE 7.  By default, all embedded IE controls default to IE 7 compatibility mode (unless for some reason somebody has IE 6 installed!), so its not possible to use most of the HTML5 features available today. Fortunately, IE 9 and greater allow the use of HTML5, and the embedded IE control actually supports it.  The problem is convincing Windows to let your program actually use those features!
      There are Registry branches that modify how an IE control works in specific programs.  Those branches are:
      HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION HKLM\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION In at least one of these branches, the executable name needs to appear as a value name ("autoit.exe" for example), and the value data needs to indicate what IE version to 'emulate'. The value data is actually dependent on the version and whether quirks-mode is enabled.
      See Web Browser Control - Specifying the IE Version for more information.
      Note that a 64-bit O/S needs adjustments to the HKLM paths.  Also, prefer the HKCU branch unless the program needs to enable access across all user accounts.

      HTML5 Canvas Element Example
      Anyway, all the complexity of setting the right value with the right name with the right 32/64-bit branch is handled for you in this UDF.  Enabling support for IE9+, and new HTML5 features, is as simple as making one call to _IE_EmbeddedSetBrowserEmulation().

      _IE_EmbeddedSetBrowserEmulation() takes an executable name (@AutoItExe if none is provided), and checks the Registry for an entry for it.  If it doesn't find one, it will create one and enable support for later versions of IE. The full parameters to the function are as follows:
       
      _IE_EmbeddedSetBrowserEmulation($nIEVersion, $bIgnoreDOCTYPE = True, $bHKLMBranch = False, $sExeName = @AutoItExe)  
      The parameter passed in $nIEVersion can be anything from 8 to 11 [or 12+ in the future], or just the current version of IE, which is available also through a call to _IE_EmbeddedGetVersion().  $bIgnoreDOCTYPE controls when IE will go into quirks mode based on any "<!DOCTYPE>" declarations on webpages. This mode can cause major problems, so by default it is set to ignore it (set this to False to enable it). $bHKLMBranch controls where in the registry the Browser Emulation Mode setting will be stored. If you wish to store the mode for ALL users, set this parameter to True. Note, however, that elevated privileges are required for modifying the HKLM branch!

      If the call to _IE_EmbeddedSetBrowserEmulation() is successful, then you can enable a (more) HTML5 compliant IE browser control in a GUI.

      The complete set of functions in the UDF:
      _IE_EmbeddedGetVersion()            ; Gets version of IE Embeddable Control (from ieframe.dll or Registry) _IE_EmbeddedGetBrowserEmulation()    ; Gets Browser Emulation Version for given Executable (or 0 if not found) _IE_EmbeddedSetBrowserEmulation()    ; Sets Browser Emulation Version. NOTE: HKLM branch REQUIRES ELEVATED PRIVILEGES! _
      IMPORTANT:
      Setting the embedded browser object to a newer version of IE may alter the behavior of some things.  See documenation for the HTMLDocumentEvents2 interface and HTMLAnchorEvents2 interface for example.
      Also, there is at least one difference in behavior noted by mesale0077 in working with IE10 (and possibly other versions of IE) - clicks for elements inside an <a> anchor tag will register as the actual internal element rather than the surrounding anchor. For example, an <img> element wrapped by an <a> anchor will only send the click to the <img> element and not propagate it any further. A workaround for this is to check the parentNode to see if it is an <a> element. See the discussion in the >ObjEvent dont work thread. It could be that there's some other reason for this behavior, but nothing has come to light yet.
      As an aside, also see trancexx's response in >ObjEvent usage for more techniques for capturing IE events.
      History:



      An example of HTML5 use, which has a little interactive Canvas, follows (requires IE9 or higher!):
       
      #include "IE_EmbeddedVersioning.au3" ; =============================================================================================================================== ; <IE_EmbeddedHTML5Example.au3> ; ; Example of using 'IE_EmbeddedVersioning' UDF ; ; This example 1st attempts to set the Browser Emulation information in the registry, then ; creates an embedded IE control with an interactive HTML5 Canvas element. ; ; Author: Ascend4nt ; =============================================================================================================================== #Region IE_CANVAS_EXAMPLE #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> ; ----------- ; GLOBALS ; ----------- Global $bMouseDown = False, $iLastX1 = 0, $iLastY1 = 0 Global $g_oCanvas, $g_oCtx Global $hGUI, $ctGUI_ErrMessageLabel Global $GUI_IE_Obj Global $nRet = _WinMain() ; Optionally remove valuename at Exit (not recommended if compiled to executable) ;~ _IE_EmbeddedRemoveBrowserEmulation() Exit $nRet ; ====================================================================================================== ; Embedded IE Browser-Emulation Fix + HTML5 Example ; ====================================================================================================== Func _WinMain()     ConsoleWrite("@AutoItX64 = " & @AutoItX64 & ", IsAdmin() = " & IsAdmin() & @CRLF)     ;; Get Current IE Embeddable Control Version (from ieframe.dll)     Local $sIEVer = _IE_EmbeddedGetVersion(), $nIEVer = @extended     ConsoleWrite("Embedded Version = " & $sIEVer & ", as Int: " & $nIEVer & ", @error = " & @error & @CRLF)     ; Old IE version w/o HTML5 support? Exit     If $nIEVer < 9 Then Return MsgBox(0, "Old IE Version", "IE version is less than 9, HTML5 example will not work")     ;; Current Browser Emulation Mode for this executable (if exists)     Local $nIEBEVer = _IE_EmbeddedGetBrowserEmulation()     ConsoleWrite("GetEmbeddedVersion: " & $nIEBEVer & ", @error = " & @error & ", @extended = " & @extended & @CRLF)     ;; Set Browser Emulation Mode for this executable (if not already set or set to a different version)     ; HKCU Branch:     _IE_EmbeddedSetBrowserEmulation()     ; HKLM Branch:     ;_IE_EmbeddedSetBrowserEmulation(-1, True, True)     If @error Then         ; -1 error means trying to access HKLM, so script needs elevation to access the Registry         If @error = -1 Then             If MsgBox(32 + 3, "Elevation Required", "Elevate script to enable setting Browser Emulation Mode?") = 6 Then Return _ReRunIfNotElevated()             Return 1         EndIf         Return MsgBox(0, "Error", "Couldn't set Browser Emulation mode")     EndIf     ;Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc")     ;; Create Embedded Browser Control and GUI     Local $oIE = _IECreateEmbedded()     ; GUI (vars are Global)     $hGUI = GUICreate("Embedded Web control Test", 460, 360, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)     $GUI_IE_Obj = GUICtrlCreateObj($oIE, 10, 10, 440, 340)     $ctGUI_ErrMessageLabel = GUICtrlCreateLabel("", 100, 500, 500, 30)     GUICtrlSetColor(-1, 0xff0000)     GUISetState(@SW_SHOW) ;Show GUI     ; Doesn't work (at least for keyboard focus):     ;~ ControlFocus($hGUI, '', $GUI_IE_Obj)     ;; Initialize Embedded Control and write some HTML5 data to it     _IENavigate($oIE, 'about:blank' )     ; Basic Near-Empty HTML (with minimal CSS styling for Canvas element)     Local $sHTML = '<!DOCTYPE html>' & @CR & '<html>' & @CR & '<head>' & @CR & _         '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR & _         '<title>Experiments</title>' & @CR & _         '<style>canvas { display:block; background-color:white; outline:#00FF00 dotted thin;}</style>' & @CR & _         '</head>' & @CR & '<body>' & @CR & '</body>' & @CR & '</html>'     _IEDocWriteHTML($oIE, $sHTML)     _IEAction($oIE, "refresh")     ;; Setup Event Object Functions     Local $oEventsDoc = ObjEvent($oIE.document, "Event_", "HTMLDocumentEvents2")     #forceref $oEventsDoc ;~     ConsoleWrite("Obj Name = " & ObjName($oIE) & @CRLF) ;~     ConsoleWrite("Location = " & $oIE.document.location.pathname & @CRLF)     ; --------------------------------------------------------------------------------------     ; Create Canvas Element through the DOM (optionally just add it in the HTML5 above)     ; -------------------------------------------------     ; Note: Support in browsers, see "Can I use..."     ;     @ http://caniuse.com/#feat=canvas     ; and @ http://caniuse.com/#search=canvas     ; -------------------------------------------------     ; IE minimum is version 9+, 10+ has more features, but WebGL support requires version 11+     ; --------------------------------------------------------------------------------------     $g_oCanvas = $oIE.document.createElement("canvas")     $g_oCanvas.id = "myCanvas" ;~     ConsoleWrite("Canvas ID = " & $g_oCanvas.id & @CRLF)     $oIE.document.body.appendChild($g_oCanvas)     ; Optionally, if added already through the HTML5 text:     ;Local $g_oCanvas = _IEGetObjById($oIE, "myCanvas")     If @error Then Return MsgBox(0, "Error", "Error creating/accessing Canvas")     ;; Tweak Canvas Size, Move into View ;~     ConsoleWrite("window innerwidth = " & $oIE.document.parentWindow.innerWidth & @CRLF)     ;$oIE.document.parentWindow.scrollTo(0, 10)     $g_oCanvas.width = 420     $g_oCanvas.height = 320     ;ConsoleWrite("Canvas item offsetTop = " & $g_oCanvas.offsetTop & @CRLF)     $g_oCanvas.scrollIntoView()     ;; Grab the Canvas 2D Context     $g_oCtx = $g_oCanvas.getContext("2d")     ;; Example Drawing: Gradiant     Local $oGrad = $g_oCtx.createLinearGradient(0,0,0,60)     If IsObj($oGrad) Then         $oGrad.addColorStop(0, "red")         $oGrad.addColorStop(1, "blue")         $g_oCtx.fillStyle = $oGrad     EndIf     $g_oCtx.fillRect(0,0,419,60)     ;; Example Drawing: Text     $g_oCtx.font = "30px serif"     $g_oCtx.fillStyle = "white"     $g_oCtx.textBaseline = "top"     $g_oCtx.fillText("HTML5 Canvas Drawing!", 50, 10)     ;; Example Drawing: Circle, Line     $g_oCtx.beginPath()     $g_oCtx.arc(200, 100, 20, 0, ACos(-1) * 2)     $g_oCtx.fillStyle = "red"     $g_oCtx.fill()     $g_oCtx.beginPath()     $g_oCtx.lineWidth = "3"     $g_oCtx.strokeStyle = "green"     $g_oCtx.moveTo(185, 85)     $g_oCtx.lineTo(215, 115)     $g_oCtx.stroke()     ; Waiting for user to close the window     While GUIGetMsg() <> $GUI_EVENT_CLOSE         Sleep(10)     WEnd     GUIDelete() EndFunc ; ====================================================================================================== ; IE Event Functions - React to Mouse events with some Canvas graphics ; ====================================================================================================== #Region IE_EVENT_FUNCS ; For right-click, the context menu pops up, UNLESS we change the Event's 'returnValue' property Volatile Func Event_oncontextmenu($oEvtObj)     If IsObj($oEvtObj) Then         ; Convert to string so that 0 doesn't match EVERY string         Local $sId = $oEvtObj.srcElement.id & ""         If ($sId = "myCanvas") Then $oEvtObj.returnValue = False     EndIf EndFunc Volatile Func Event_onmousedown($oEvtObj)     If IsObj($oEvtObj) And IsObj($g_oCtx) Then         ; Map click coordinates to Canvas coordinates         $iLastX1 = $oEvtObj.x - $g_oCanvas.offsetLeft         $iLastY1 = $oEvtObj.y - $g_oCanvas.offsetTop ;~         ConsoleWrite("Downclick recvd at X1: " & $iLastX1 & ", Y1: " & $iLastY1 & ", MouseButton [1 = left, 2 = right, etc] = " & $oEvtObj.button & @CRLF)         ; Check if click was in fact within Canvas element         If $iLastX1 >= 0 And $iLastX1 < $g_oCanvas.width And $iLastY1 >= 0 And $iLastY1 < $g_oCanvas.height Then             ; Signal mouse-down occurred inside Canvas             $bMouseDown = 1             ; Make a small square where initial down-click was detected             $g_oCtx.fillStyle = "blue"             $g_oCtx.fillRect($iLastX1 - 2, $iLastY1 - 2, 3, 3)         EndIf     EndIf EndFunc Volatile Func Event_onmouseup($oEvtObj)     If IsObj($oEvtObj) And IsObj($g_oCtx) Then ;~         ConsoleWrite("MouseUp" & @LF)         If $bMouseDown Then             Local $iX = $oEvtObj.x - $g_oCanvas.offsetLeft, $iY = $oEvtObj.y - $g_oCanvas.offsetTop             ; Random color in "#0f1100" (RGB) string form             Local $sColor = "#" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2)             ;; Draw either a line or circle depending on where the mouse button is released             If $iX = $iLastX1 And $iY = $iLastY1 Then                 ; Circle if mouse start = mouse end                 $g_oCtx.beginPath()                 $g_oCtx.arc($iX, $iY, 8, 0, ACos(-1) * 2)                 $g_oCtx.fillStyle = $sColor                 $g_oCtx.fill()             Else                 ; Line if mouse start <> mouse end                 $g_oCtx.beginPath()                 $g_oCtx.lineWidth = "3"                 $g_oCtx.strokeStyle = $sColor                 $g_oCtx.moveTo($iLastX1, $iLastY1)                 $g_oCtx.lineTo($iX, $iY)                 $g_oCtx.stroke()             EndIf             $bMouseDown = 0         EndIf     EndIf EndFunc Volatile Func Event_onkeydown($oEvtObj)     If IsObj($oEvtObj) Then         ConsoleWrite("Event type: " & $oEvtObj.type & "id (0 is document) = " & $oEvtObj.srcElement.id)         ConsoleWrite(", keycode = " & $oEvtObj.keyCode & ", shiftkey = " & $oEvtObj.shiftKey & @CRLF)     EndIf EndFunc ; ====================================================================================================== #EndRegion IE_EVENT_FUNCS #EndRegion IE_CANVAS_EXAMPLE #Region UTIL_FUNCS ; ====================================================================================================== ; Func _ReRunIfNotElevated() ; ; Does what it says. (rumored to occasionally say what it does) ; ; Author: Ascend4nt ; ====================================================================================================== Func _ReRunIfNotElevated()     If IsAdmin() Then         Return 0     Else         If @Compiled Then             ; If compiled to A3X, we need to execute it as if not compiled.             Local $sCmd = (@AutoItExe = @ScriptFullPath) ? "" : ("/AutoIt3ExecuteScript " & @ScriptFullPath)             Return ShellExecute(@AutoItExe, $sCmd, @ScriptDir, "runas")         Else             Return ShellExecute(@AutoItExe,@ScriptFullPath,@ScriptDir,"runas")         EndIf     EndIf EndFunc #EndRegion UTIL_FUNCS IEEmbeddedVersioning.zip ~prev Downloads: 61
      Also, HTML5+Javascript standalone Canvas demo (should run in any browser): HTML5StandaloneCanvasDemo.zip