Sign in to follow this  
Followers 0
Ealric

Swiss File Knife GUI

9 posts in this topic

#1 ·  Posted (edited)

I'm enclosing a .rar file that includes the sfk.exe, the .au3 file, the .ini file, and a demo.

NOTE: You need to use the .au3 file as it acts as the frontend executable while the sfk.exe is the backend dos executable.

What does this file do?

This program allows you to take any number of keywords located in a .txt file (one per line), and search through any number of files (you decide the extensions, if any that you want to search through) to find out if these keywords are located in those files. If they are, they are written to an output directory and later on an HTML file is created with a table listing of each keyword along with the file path and file (or file only if you check the box). This allows you to do many things:

Example:

I have a keyword.txt file that contains the following

ClearFocus

SpecialParse

_Timer

LabelMaker()

I have an AU3 directory that houses every script I ever created (let's say I have 500 .au3 files here). I want to find out what files I've used these functions in. I can run the program, set the input path to the AU3 directory, check the box if I want to return just the names, and then press the SFK button and choose my keyword.txt file that contains my keywords. The program then browses all 500 files and any sub-directories of the parent directory I set it to, and creates an file in the output directory named after the keyword (ex. Clearfocus.txt, SpecialParse.txt). After the program is done browsing, it prompts you to decide whether or not you want an html output. (I recommend saying yes). If yes, an html file named output.html is created in the output directory in a table structure showing you all of the results.

Why did I make this program?

This program was written by me when I wanted to find out what API functions were listed in what .lua and .xml files in World of Warcraft. The WoW API list is close to 1,700 functions! So, this would take a long time to search through. I found SFK.exe at sourceforge but unfortunately, as with any dos console utility, it had it's limitations and problems. I wrote a graphical extension to this program to do what I needed to and made it more user friendly in the process.

I parsed out the functions from WoW which were saved in a .txt file. Using this program, I was able to take each of those functions (keywords) (over 1700 of them) and browse through over 50 files (.lua and .xml) and determine what files they appeared in. The program then took snapshots of these file listings, and then output them to an HTML table so that I could better browse and manage where they were located. This allowed me to manage the WoW API system as I like to do programming for addons.

Testing Directions

Unzip the program.

Run the SFKGui.exe file in demo.

Click the [...] next to Parent Directory and set it to the "Input" folder in Demo.

Check the box so file names are only returned or not if you want the full path.

Leave the file extensions alone for the test (leave them set to .au3 .doc and .txt)

Click the SFK button and browse to the Source directory and use the autoit_functions.txt file as your keywords.

Watch the results.

Say yes on HTML to get an HTML page.

When finished compiling, go to your Output directory and find the output.html file and look at it.

Usable Directions

You can use any .txt file for your keywords (separate them one per line) - The file can be located anywhere (I just put them in source to make it easier to find)

On the Parent directory selection, you can select "any" starting directory. You can even set your C: drive if you wanted (although that would mean a longer search)

Set your file extensions to anything you want .doc .htm .xml .au3 etc. or leave them empty for "all" files

Click the SFK button and find your keywords text file.

Wait for results and publish to html or not.

Enjoy.

AU3 File is enclosed in .rar but here it is with full comments:

#include <Array.au3>
#include <Date.au3>
#include <File.au3>
#include <GUIConstants.au3>


Global $author = "Ealric", $version = "1.0.4"
Global $path = @ScriptDir
; ## Create our input, output, and source directories
DirCreate(@ScriptDir & "\input")
DirCreate(@ScriptDir & "\output")
DirCreate(@ScriptDir & "\source")
Global $parent = GUICreate("Swiss File Knife Parser: " & $version, 600, 245)
; ## sfk.exe is the dos executable that does the grunt work
; ## format paths to Dos 8.3 filename standards since we are working with Dos
; ## .. console executables
Global $SFK = _input($path) & 'sfk.exe'
; ## format path to Dos 8.3 filename and set output directory in script dir.
Global $output = _input($path & "\output")
; ## switch commands for sfk which return file names only and apply to a specific
; ## directory and pattern (do not change!)
Global $find = " find -names -dir "
Global $pat = " -pat "
; ## below is a listing of the file types you are going to parse to see if the
; ## keywords are listed within them.
GUICtrlCreateGroup("File Extensions", 325, 15, 255, 80)
GUICtrlCreateLabel("List file extensions you want to search, " & _
        "separating each type with one space only.", 340, 35, 225, 40)
Global $gCFEXT = GUICtrlCreateInput(".lua .xml", 340, 70, 225, 20)
; ## below is a choice for selecting a beginning search directory to start in
; ## note that you can select a parent directory and it will search all sub-directories
; ## choosing the c:\ root for instance will cause the program to search "every"
; ## directory on your drive (this will create a long search time)
GUICtrlCreateGroup("Parent Directory", 325, 110, 255, 80)
GUICtrlCreateLabel("Select a Parent Directory or Sub-Directory " & _
        "for sfk to start searching from initially.", 340, 130, 225, 40)
Global $dirBTN = GUICtrlCreateButton("...", 340, 165, 50, 20)
; ## this box if checked, determines whether or not to return just the file names
; ## only.  If not checked, the entire path + file name will be returned.
Global $dirCHKBOX = GUICtrlCreateCheckbox("Return File Names Only", 410, 165, 150, 20)
; ## globals used for the extension types and the control reads
Global $ext, $grEXT, $dOpen
; ## globals used for the number of keywords and for determining timer start/stop
; ## and directory settings
Global $fCount, $timerstop, $dirset = 0
; ## globals used for HH:MM:SS time format
Global $Secs, $Mins, $Hour, $Time

; ## HTML Options (All are set in the sfk.ini so do not touch values below)
; ## Edit values directly in the .ini file itself

; ## First Left Column Header
$tcolheader1 = IniRead($path & "\sfk.ini", "html", "colheader1", "Keyword Name")
; ## First Left Column Alignment
$tcolheader1align = IniRead($path & "\sfk.ini", "html", "colheader1align", "center")
; ## First Left Column Font Weight
$tcolheader1weight = IniRead($path & "\sfk.ini", "html", "colheader1weight", "bold")
; ## First Left Column Font Color
$tcolheader1color = IniRead($path & "\sfk.ini", "html", "colheader1color", "#000080")
; ## Second Right Column Header
$tcolheader2 = IniRead($path & "\sfk.ini", "html", "colheader2", "Located In")
; ## Second Right Column Alignment
$tcolheader2align = IniRead($path & "\sfk.ini", "html", "colheader2align", "center")
; ## Second Right Column Font Weight
$tcolheader2weight = IniRead($path & "\sfk.ini", "html", "colheader2weight", "bold")
; ## Second Right Column Font Color
$tcolheader2color = IniRead($path & "\sfk.ini", "html", "colheader2color", "#000080")
; ## Overall Table Width
$tWidth = IniRead($path & "\sfk.ini", "html", "tWidth", "80%")
; ## Table Border Spacing
$tBorderSpacing = IniRead($path & "\sfk.ini", "html", "BorderSpacing", "0px")
; ## Table Cell Spacing
$tCellSpacing = IniRead($path & "\sfk.ini", "html", "CellSpacing", "0")
; ## Left Column Width
$tlColWidth = IniRead($path & "\sfk.ini", "html", "lColWidth", "50.00%")
; ## Right Column Width
$trColWidth = IniRead($path & "\sfk.ini", "html", "rColWidth", "50.00%")
; ## Left Border Style
$tBorderLeftStyle = IniRead($path & "\sfk.ini", "html", "BorderLeftStyle", "Solid")
; ## Left Border Color
$tBorderLeftColor = IniRead($path & "\sfk.ini", "html", "BorderLeftColor", "#d8d8d8")
; ## Top Border Style
$tBorderTopStyle = IniRead($path & "\sfk.ini", "html", "BorderTopStyle", "Solid")
; ## Top Border Color
$tBorderTopColor = IniRead($path & "\sfk.ini", "html", "BorderTopColor", "#d8d8d8")
; ## Right Border Style
$tBorderRightStyle = IniRead($path & "\sfk.ini", "html", "BorderRightStyle", "Solid")
; ## Right Border Color
$tBorderRightColor = IniRead($path & "\sfk.ini", "html", "BorderRightColor", "#d8d8d8")
; ## Bottom Border Style
$tBorderBottomStyle = IniRead($path & "\sfk.ini", "html", "BorderBottomStyle", "Solid")
; ## Bottom Border Color
$tBorderBottomColor = IniRead($path & "\sfk.ini", "html", "BorderBottomColor", "#d8d8d8")
; ## Top Border Width
$tBorderTopWidth = IniRead($path & "\sfk.ini", "html", "BorderTopWidth", "2px")
; ## Right Border Width
$tBorderRightWidth = IniRead($path & "\sfk.ini", "html", "BorderRightWidth", "2px")
; ## Left Border Width
$tBorderLeftWidth = IniRead($path & "\sfk.ini", "html", "BorderLeftWidth", "2px")
; ## Bottom Border Width
$tBorderBottomWidth = IniRead($path & "\sfk.ini", "html", "BorderBottomWidth", "2px")
; ## Background Color for Column Headers
$tBackgroundColor = IniRead($path & "\sfk.ini", "html", "BackgroundColor", "#ffff00")
; ## Alternate Row Color Shading for Even Numbered Rows
$tAltRowColor = IniRead($path & "\sfk.ini", "html", "AltRowColor", "#dddddd")
GUICtrlCreateGroup("Instructions", 10, 10, 290, 102)
GUICtrlCreateLabel("1. Enter the file extensions you wish to search within." & @CRLF & _
        "2. Select a Parent or Sub Directory that your initial search     " & _
        "will start within." & @CRLF & _
        "3. Click the SFK button and browse for the file that    " & _
        "            contains your searchable " & _
        "keywords.", 20, 30, 270, 80)
; ## Progress Bar that shows overall progress of parsing
Global $pbar = GUICtrlCreateProgress(20, 125, 260, 20)
; ## Label that shows keywords as they are processed
Global $plabel = GUICtrlCreateLabel("File Names", 20, 155, 160, 20)
; ## Label that shows the number of remaining keywords to be processed
Global $statusl = GUICtrlCreateLabel($fCount, 20, 170, 160, 20)
; ## Start Time
Global $timelabel = GUICtrlCreateLabel("", 200, 155, 110, 20)
; ## Progressive Time
Global $endtime = GUICtrlCreateLabel("", 200, 170, 110, 20)
; ## Directory to start initial search in (Parent or Sub Directory)
Global $dOpenlabel = GUICtrlCreateLabel("", 110, 205, 470, 40)
GUISetState(@SW_SHOW, $parent)
; Our SKF button to start the program and select our source .txt keywords
Local $PARSEb = GUICtrlCreateButton("&SFK", 10, 210, 60, 20, $BS_DEFPUSHBUTTON)
GUICtrlSetState($PARSEb, $GUI_FOCUS)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $PARSEb
            ; ## reset our timer variable
            $timerstop = 0
            ; ## check to make sure the default search directory is set
            _checkdirset()
            ; ## read our input extensions
            $grEXT = GUICtrlRead($gCFEXT)
            ; ## set the input extensions in the switch
            $ext = " -file " & $grEXT
            ; ## start parsing keywords
            _parse()
        Case $dirBTN
            ; ## select a folder in the browse box
            $dOpen = FileSelectFolder("Choose Parent/Sub Directory to start your Search.", "")
            ; ## format the file path to 8.3 dos short path standards
            $dOpen = _input($dOpen)
            ; ## set our directory label in the main gui
            GUICtrlSetData($dOpenlabel, $dOpen)
    EndSwitch
WEnd

Func _parse()
    ; ## Check to see that the sfk.exe file exists
    If FileExists($SFK) Then
        ; ## Check to see that the default search directory has been set
        If $dirset = 1 Then
            Local $aFunctions
            Local $t, $i = 0
            ; ## select a .txt file that contains the keywords you will use as your search
            ; ## pattern. This file should contain one keyword or search criteria per line
            ; ## and can be as long as you wish.
            Global $fOpen = FileOpenDialog("Choose Path\Filename.* that contains your searchable keywords", $path, "Text files (*.txt)")
            ; ## read the keywords to an array
            _FileReadToArray($fOpen, $aFunctions)
            If IsArray($aFunctions) = 1 Then
                ; ## Set the start time label
                GUICtrlSetData($timelabel, "Start Time: " & _NowTime())
                Global $timer = TimerInit()
                AdlibEnable("Timer", 50)
                ; ## set variables to be used in the progress bar
                $t = 100 / $aFunctions[0]
                $fCount = $aFunctions[0]
                For $x = 1 To $aFunctions[0]
                    ; ## Set our keyword count and count backwards to 0
                    GUICtrlSetData($statusl, $fCount - 1 & " Keys to Parse")
                    GUICtrlSetData($plabel, $aFunctions[$x])
                    ; ## This is our main console command for sfk.exe
                    Local $dirRD = GUICtrlRead($dOpenlabel)
                    ; ## Run our sfk.exe with switches and output to the \output directory
                    ; ## Output directory is located in @ScriptDir\Output\
                    RunWait(@ComSpec & " /c " & $SFK & $find & $dirRD & _
                            $pat & $aFunctions[$x] & $ext & _
                            ' > ' & $output & $aFunctions[$x] & '.txt', "", @SW_HIDE)
                    $i = $x * $t
                    ; ## Set our progress bar
                    GUICtrlSetData($pbar, $i)
                    $fCount = $fCount - 1
                Next
                ; Begin html query processing
                _htmlquery()
            Else
                MsgBox(48, "File not valid", "The file you are attempting to open can not be written to an array or you chose to cancel out of file selection.")
            EndIf
        Else
            MsgBox(48, "Error", "No Directory has been set yet.")
        EndIf
    Else
        MsgBox(48, "Error", "The file path to the executable does not exist or is incorrect.")
    EndIf
EndFunc   ;==>_parse

; ## Timer Function
; ## Converts ticks to time and formats our Timer Label
Func Timer()
    If $timerstop <> 1 Then
        _TicksToTime(Int(TimerDiff($timer)), $Hour, $Mins, $Secs)
        Local $sTime = $Time ; save current time to be able to test and avoid flicker..
        $Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
        If $sTime <> $Time Then GUICtrlSetData($endtime, "Time Trans: " & $Time)
    EndIf
EndFunc   ;==>Timer

; ## _htmlquery() Function
; ## Decides whether or not you want HTML output which will create a table of your output
Func _htmlquery()
    $timerstop = 1
    Local $yesno = MsgBox(36, "Create HTML", "Do you want to create an html file showing " & _
            "the data you've just parsed?")
    If $yesno = 6 Then
        ; ## If you select yes, you will go to the htmlcreate function
        _htmlcreate()
    Else
        MsgBox(64, "Completed", "Parsing has been completed.")
        FileClose($fOpen)
    EndIf
EndFunc   ;==>_htmlquery

; ## _htmlcreate() Function
Func _htmlcreate()
    ; ## Set our output.html file and place it in the output directory
    Local $hfilepath = $path & '\output\output.html'
    ; ## Open output.html and erase all previous contents
    Local $hFile = FileOpen($hfilepath, 2)
    Local $aNames
    ; ## Start writing our HTML
    FileWrite($hFile, "<html>" & @CRLF)
    Local $tablewrite = _table()
    ; ## Write the table entry headers and initial columns
    FileWrite($hFile, $tablewrite)
    ; ## Read our keyworks to an array
    _FileReadToArray($fOpen, $aNames)
    If IsArray($aNames) = 1 Then
        For $x = 1 To $aNames[0]
            Local $pfilepath = $path & '\output\' & $aNames[$x] & ".txt"
            Local $aFilelines
            ; ## Find filenames.txt that match our keywords by name and store
            ; ## ... all of their contents to an array
            _FileReadToArray($pfilepath, $aFilelines)
            If IsArray($aFilelines) = 1 Then
                ; ## Check to see if it's an even numbered row
                ; ## If so, color it
                If Mod($x, 2) = 0 Then
                    Local $cVAR = _colrow($aNames[$x])
                    FileWrite($hFile, $cVAR)
                    For $y = 1 To $aFilelines[0] - 1
                        If $aFilelines[$y] <> "" Then
                            ; ## If we just want names of the files only and not
                            ; ## the entire path, we can separate the directory 
                            ; ## structure here and store each sub-directory to 
                            ; ## an array.
                            ; ## This is determined initially with our checkbox.
                            If BitOR(GUICtrlRead($dirCHKBOX), $GUI_CHECKED) = $GUI_CHECKED Then
                                $aSplit = StringSplit($aFilelines[$y], '\', 1)
                                FileWrite($hFile, $aSplit[$aSplit[0]] & " <br>")
                            Else
                                FileWrite($hFile, $aFilelines[$y] & " <br>")
                            EndIf
                        Else
                            FileWrite($hFile, "none")
                        EndIf
                    Next
                    FileWrite($hFile, '</td></tr>')
                ; ## If It's an odd number don't color the rows
                Else
                    Local $nocVAR = _nocolrow($aNames[$x])
                    FileWrite($hFile, $nocVAR)
                    For $y = 1 To $aFilelines[0] - 1
                        If $aFilelines[$y] <> "" Then
                            ; ## If we just want names of the files only and not
                            ; ## the entire path, we can separate the directory 
                            ; ## structure here and store each sub-directory to 
                            ; ## an array.
                            ; ## This is determined initially with our checkbox.
                            If BitOR(GUICtrlRead($dirCHKBOX), $GUI_CHECKED) = $GUI_CHECKED Then
                                $aSplit = StringSplit($aFilelines[$y], '\', 1)
                                FileWrite($hFile, $aSplit[$aSplit[0]] & " <br>")
                            Else
                                FileWrite($hFile, $aFilelines[$y] & " <br>")
                            EndIf
                        Else
                            FileWrite($hFile, "none")
                        EndIf
                    Next
                    FileWrite($hFile, '</td></tr>')
                EndIf
            Else
                FileWrite($hFile, "<tr>")
                FileWrite($hFile, "<td>" & $aNames[$x] & "</td>")
                FileWrite($hFile, "<td> none </td>")
                FileWrite($hFile, "</tr>")
            EndIf
        Next
    Else
        MsgBox(48, "Error", "No Array for Source Keywords can be found")
    EndIf
    FileWrite($hFile, @CRLF & "</table>")
    FileWrite($hFile, @CRLF & "</html>")
    FileClose($fOpen)
    FileClose($hFile)
    MsgBox(64, "Completed", "Parsing has been completed.")
EndFunc   ;==>_htmlcreate

; ## _checkdirset() function
; ## If our label is not empty then set our directory to 1 which means it is defined
Func _checkdirset()
    If GUICtrlRead($dOpenlabel) <> "" Then
        $dirset = 1
    EndIf
EndFunc   ;==>_checkdirset

; ## _input() function
; ## Check our path variable and see if it is longer than 8 characters
; ## If it is, apply 8.3 dos short path structure to it
; ## In addition, if a directory contains a period, ignore the short directory
; ## and use the full folder name (ex. john.collins instead of john.c~1)
; ## Set our input and output directory path formats here.
Func _input($var)
    Local $len, $leftbuild, $rightbuild, $newpath
    $oSplit = StringSplit($var, '\', 1)
    For $i = 1 To $oSplit[0]
        $len = StringLen($oSplit[$i])
        If $len > 8 Then
            If StringInStr($oSplit[$i], ".") <> 0 Then
                $newpath = $newpath & $oSplit[$i] & "\"
            Else
                $leftbuild = StringLeft($oSplit[$i], 6)
                $rightbuild = "~1"
                $newpath = $newpath & $leftbuild & $rightbuild & "\"
            EndIf
        Else
            ; ## If the root of C:\ is chosen, format so C:\ doesn't return as C:\\
            If $oSplit[$i] = "" Then
                $newpath = $newpath & $oSplit[$i]
            Else
                $newpath = $newpath & $oSplit[$i] & "\"
            EndIf
        EndIf
    Next
    $var = $newpath
    Return $var
EndFunc   ;==>_input

; Creates and writes the table header and the column headers
Func _table()
    $table = '<!--(Table)=========================================================-->' & _
            @CRLF & "<table x-use-null-cells" & _
            @CRLF & '       style="x-cell-content-align: top;' & _
            @CRLF & '               width: ' & $tWidth & ';' & _
            @CRLF & '               border-spacing: ' & $tBorderSpacing & ';' & _
            @CRLF & '               border-spacing: ' & $tBorderSpacing & ';"' & _
            @CRLF & '       cellspacing=0' & _
            @CRLF & '       width=' & $tWidth & '>' & _
            @CRLF & '<col style="width: ' & $tlColWidth & ';">' & _
            @CRLF & '<col style="width: ' & $trColWidth & ';">' & _
            @CRLF & '<tr style="x-cell-content-align: top;"' & _
            @CRLF & '   valign=top>' & _
            @CRLF & '<td style="border-left-style: ' & $tBorderLeftStyle & ';' & _
            @CRLF & '           border-left-color: ' & $tBorderLeftColor & ';' & _
            @CRLF & '           border-top-style: ' & $tBorderTopStyle & ';' & _
            @CRLF & '           border-top-color: ' & $tBorderTopColor & ';' & _
            @CRLF & '           border-right-style: ' & $tBorderRightStyle & ';' & _
            @CRLF & '           border-right-color: ' & $tBorderRightColor & ';' & _
            @CRLF & '           border-bottom-style: ' & $tBorderBottomStyle & ';' & _
            @CRLF & '           border-bottom-color: ' & $tBorderBottomColor & ';' & _
            @CRLF & '           border-right-width: ' & $tBorderRightWidth & ';' & _
            @CRLF & '           border-left-width: ' & $tBorderLeftWidth & ';' & _
            @CRLF & '           border-top-width: ' & $tBorderTopWidth & ';' & _
            @CRLF & '           border-bottom-width: ' & $tBorderBottomWidth & ';' & _
            @CRLF & '           background-color: ' & $tBackgroundColor & ';"' & _
            @CRLF & '   bgcolor=' & $tBackgroundColor & '' & _
            @CRLF & '   width=' & $tlColWidth & '>' & _
            @CRLF & '<p style="text-align: ' & $tcolheader1align & ';' & _
            @CRLF & '           font-weight: ' & $tcolheader1weight & ';' & _
            @CRLF & '           color: ' & $tcolheader1color & ';"' & _
            @CRLF & '   align=center>' & $tcolheader1 & '</td>' & _
            @CRLF & '<td style="border-top-style: ' & $tBorderTopStyle & ';' & _
            @CRLF & '           border-top-color: ' & $tBorderTopColor & ';' & _
            @CRLF & '           border-right-style: ' & $tBorderRightStyle & ';' & _
            @CRLF & '           border-right-color: ' & $tBorderRightColor & ';' & _
            @CRLF & '           border-bottom-style: ' & $tBorderBottomStyle & ';' & _
            @CRLF & '           border-bottom-color: ' & $tBorderBottomColor & ';' & _
            @CRLF & '           border-top-width: ' & $tBorderTopWidth & ';' & _
            @CRLF & '           border-bottom-width: ' & $tBorderBottomWidth & ';' & _
            @CRLF & '           border-right-width: ' & $tBorderRightWidth & ';' & _
            @CRLF & '           background-color: ' & $tBackgroundColor & ';"' & _
            @CRLF & '   bgcolor=' & $tBackgroundColor & '' & _
            @CRLF & '   width=' & $trColWidth & '>' & _
            @CRLF & '<p style="text-align: ' & $tcolheader2align & ';' & _
            @CRLF & '           font-weight: ' & $tcolheader2weight & ';' & _
            @CRLF & '           color: ' & $tcolheader2color & ';"' & _
            @CRLF & '   align=center>' & $tcolheader2 & '</td></tr>'
    Return $table
EndFunc   ;==>_table

; Produces an "even" row in the table with applied color formatting
Func _colrow($var1)
    Local $sCOL
    $sCOL = '<tr style="x-cell-content-align: top;"' & _
            @CRLF & '   valign=top>' & _
            @CRLF & '<td style="width: ' & $tlColWidth & ';' & _
            @CRLF & '           border-left-color: ' & $tBorderLeftColor & ';' & _
            @CRLF & '           border-left-style: ' & $tBorderLeftStyle & ';' & _
            @CRLF & '           border-right-color: ' & $tBorderRightColor & ';' & _
            @CRLF & '           border-right-style: ' & $tBorderRightStyle & ';' & _
            @CRLF & '           border-bottom-color: ' & $tBorderBottomColor & ';' & _
            @CRLF & '           border-bottom-style: ' & $tBorderBottomStyle & ';' & _
            @CRLF & '           border-bottom-width: ' & $tBorderBottomWidth & ';' & _
            @CRLF & '           border-right-width: ' & $tBorderRightWidth & ';' & _
            @CRLF & '           border-left-width: ' & $tBorderLeftWidth & ';' & _
            @CRLF & '           background-color: ' & $tAltRowColor & ';"' & _
            @CRLF & '   bgcolor=' & $tAltRowColor & '' & _
            @CRLF & '   width=' & $tlColWidth & '>' & $var1 & '</td>' & _
            @CRLF & '<td style="width: ' & $trColWidth & ';' & _
            @CRLF & '           border-right-color: ' & $tBorderRightColor & ';' & _
            @CRLF & '           border-right-style: ' & $tBorderRightStyle & ';' & _
            @CRLF & '           border-bottom-color: ' & $tBorderBottomColor & ';' & _
            @CRLF & '           border-bottom-style: ' & $tBorderBottomStyle & ';' & _
            @CRLF & '           border-bottom-width: ' & $tBorderBottomWidth & ';' & _
            @CRLF & '           border-right-width: ' & $tBorderRightWidth & ';' & _
            @CRLF & '           background-color: ' & $tAltRowColor & ';"' & _
            @CRLF & '   bgcolor=' & $tAltRowColor & '' & _
            @CRLF & '   width=' & $trColWidth & '>'
    Return $sCOL
EndFunc   ;==>_colrow

; Produces an "odd" row in the table with no color formatting
Func _nocolrow($var1)
    Local $sNOCOL
    $sNOCOL = '<tr style="x-cell-content-align: top;"' & _
            @CRLF & '   valign=top>' & _
            @CRLF & '<td style="width: ' & $tlColWidth & ';' & _
            @CRLF & '           border-left-color: ' & $tBorderLeftColor & ';' & _
            @CRLF & '           border-left-style: ' & $tBorderLeftStyle & ';' & _
            @CRLF & '           border-right-color: ' & $tBorderRightColor & ';' & _
            @CRLF & '           border-right-style: ' & $tBorderRightStyle & ';' & _
            @CRLF & '           border-bottom-color: ' & $tBorderBottomColor & ';' & _
            @CRLF & '           border-bottom-style: ' & $tBorderBottomStyle & ';' & _
            @CRLF & '           border-bottom-width: ' & $tBorderBottomWidth & ';' & _
            @CRLF & '           border-right-width: ' & $tBorderRightWidth & ';' & _
            @CRLF & '           border-left-width: ' & $tBorderLeftWidth & ';"' & _
            @CRLF & '   width=' & $tlColWidth & '>' & $var1 & '</td>' & _
            @CRLF & '<td style="width: ' & $trColWidth & ';' & _
            @CRLF & '           border-right-color: ' & $tBorderRightColor & ';' & _
            @CRLF & '           border-right-style: ' & $tBorderRightStyle & ';' & _
            @CRLF & '           border-bottom-color: ' & $tBorderBottomColor & ';' & _
            @CRLF & '           border-bottom-style: ' & $tBorderBottomStyle & ';' & _
            @CRLF & '           border-bottom-width: ' & $tBorderBottomWidth & ';' & _
            @CRLF & '           border-right-width: ' & $tBorderRightWidth & ';"' & _
            @CRLF & '   width=' & $trColWidth & '>'
    Return $sNOCOL
EndFunc   ;==>_nocolrow

Demo.rar

output.html

Edited by Ealric

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Edited and added version 1.0.4.

Fixed the path for the directory input if C:\ was selected so that it now shows C:\ instead of C:\\ .

Added an .ini input for the starting file extension types to search for. You can now set these in the .ini file. You can still set these in the program, but the preset values in the .ini are for if you know you will be searching certain file extensions all of the time.

Changed the Demo so that it now shows you the autoit example of searching autoit functions within .au3 files to create an output.html formatted file.

I've added an example output.html file example so you can see what the output looks like once finished.

Enjoy the changes.

Edited by Ealric

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Share this post


Link to post
Share on other sites

It's sad when a good script gets no replies...

Share this post


Link to post
Share on other sites

This looks very nice! I will test it out tomorrow on a project I had dumped on me. It consists of an industrial control application that has been compiled into binaries with tag names for HMI buried as strings inside along with coresponding IO points. I have a list of tagnames but not the IO. If this will work, I should be able to bounce my list of tagnames against your script and parse the binary files for the strings.

Share this post


Link to post
Share on other sites

AWESOME Job man! I <3 you. Just posting to give you the props you deserve =D

Share this post


Link to post
Share on other sites

AWESOME Job man! I <3 you. Just posting to give you the props you deserve =D

Good Job.. I like it!


code

Share this post


Link to post
Share on other sites

C:DemoSFKGui.au3(129,79) : WARNING: $BS_DEFPUSHBUTTON: possibly used before declaration.

Local $PARSEb = GUICtrlCreateButton("&SFK", 10, 210, 60, 20, $BS_DEFPUSHBUTTON)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:DemoSFKGui.au3(129,79) : ERROR: $BS_DEFPUSHBUTTON: undeclared global variable.

Local $PARSEb = GUICtrlCreateButton("&SFK", 10, 210, 60, 20, $BS_DEFPUSHBUTTON)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:DemoSFKGui.au3(175,28) : ERROR: AdlibEnable(): undefined function.

AdlibEnable("Timer", 50)

~~~~~~~~~~~~~~~~~~~~~~~^

C:DemoSFKGui.au3 - 2 error(s), 1 warning(s)

Share this post


Link to post
Share on other sites

@tom2pd

This script is 4 years old, the language has changed in the last 4 years, look up what those errors are, and see if the changelogs mention anything about them. I'm sure you'll find the answer to your problems.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

C:DemoSFKGui.au3(129,79) : WARNING: $BS_DEFPUSHBUTTON: possibly used before declaration.

Local $PARSEb = GUICtrlCreateButton("&SFK", 10, 210, 60, 20, $BS_DEFPUSHBUTTON)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:DemoSFKGui.au3(129,79) : ERROR: $BS_DEFPUSHBUTTON: undeclared global variable.

Local $PARSEb = GUICtrlCreateButton("&SFK", 10, 210, 60, 20, $BS_DEFPUSHBUTTON)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:DemoSFKGui.au3(175,28) : ERROR: AdlibEnable(): undefined function.

AdlibEnable("Timer", 50)

~~~~~~~~~~~~~~~~~~~~~~~^

C:DemoSFKGui.au3 - 2 error(s), 1 warning(s)

Just replace the AdlibEnable() function with AdlibRegister() and Place this at the top of the script "#Include <ButtonConstants.au3>".


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

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
Sign in to follow this  
Followers 0