Jump to content

Script/Text/File Manager - Update 4/6/2015


Valuater
 Share

Recommended Posts

Advanced from the Simple Script Finder

UpDated - Ver 1.0.8 - April 6, 2015 

Now - will search and edit/run/etc User Defined file types




File_Manager_zpste044vqi.jpg





#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#include <File.au3>
#include <Array.au3>
#include <GuiListBox.au3>

; Ver 1.0.8 April 6, 2015

$SS_SUNKEN = 0x1000
$SS_CENTER = 0x01


FileDelete(@TempDir & "\au3.txt")
OnAutoItExitRegister("endscript")
Dim $TInfo, $R_[7], $Temp_File, $Temp_Type = StringSplit(".au3,.txt,.ini,.dat,.log,", ",")
Dim $Last_loc = "C:\Program Files\AutoIt3\Examples"
$AutoItBetaLocation = IniRead(@ScriptDir & "\IE-library.ini", "exe", "dir", "")
$Program_2 = $AutoItBetaLocation & "\Autoit3.exe"

$maingui = GUICreate("Script/Text Manager       v1.0.8", 500, 365)
GUISetFont(9, 400, -1, "MS Sans Serif")
$vStatus = GUICtrlCreateLabel("View: Search Window", 0, 350, 130, 15, $SS_SUNKEN + $SS_CENTER)
GUICtrlCreateLabel("Manager Status:", 130, 350, 120, 15, $SS_SUNKEN + $SS_CENTER)
$Status = GUICtrlCreateLabel("System is Ready...", 250, 350, 250, 15, $SS_SUNKEN + $SS_CENTER)
GUICtrlSetColor(-1, 0xff0000)
GUISetState()

$searchgui = GUICreate("Script Finder", 500, 350, 0, 0, $WS_CHILD + $WS_BORDER, "", $maingui)
GUISetFont(9, 400, -1, "MS Sans Serif")
$location = GUICtrlCreateInput($Last_loc, 20, 20, 340, 20)
$C_browse = GUICtrlCreateCheckbox("All Sub-Folders", 380, 20, 100, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$browse_btn = GUICtrlCreateButton("Browse Folders", 380, 50, 100, 20)
$R_word = GUICtrlCreateRadio("", 20, 50, 20, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$word_search = GUICtrlCreateInput("Search word/phrase", 40, 50, 145, 20)
$R_title = GUICtrlCreateRadio("", 195, 50, 20, 20)
$title_search = GUICtrlCreateInput("Search FileName/Folder", 215, 50, 145, 20)
GUICtrlCreateGroup('File Type', 20, 78, 340, 38)
$R_[1] = GUICtrlCreateRadio(".au3", 30, 92, 50, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$R_[2] = GUICtrlCreateRadio(".txt", 80, 92, 50, 20)
$R_[3] = GUICtrlCreateRadio(".ini", 130, 92, 50, 20)
$R_[4] = GUICtrlCreateRadio(".dat", 180, 92, 50, 20)
$R_[5] = GUICtrlCreateRadio(".log", 230, 92, 50, 20)
$R_[6] = GUICtrlCreateRadio("", 280, 92, 15, 20)
$R_Input = GUICtrlCreateInput("Type", 298, 90, 50, 20)
$go_btn = GUICtrlCreateButton("Start Search", 380, 85, 100, 30)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
$Edit1 = GUICtrlCreateList("Found File list", 20, 130, 460, 150, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_DISABLENOSCROLL, $WS_HSCROLL))
_GUICtrlListBox_SetHorizontalExtent($Edit1, 720)
$label = GUICtrlCreateLabel("Files Found with Phrase: None", 140, 290, 220, 20, $SS_SUNKEN + $SS_CENTER)
$label2 = GUICtrlCreateLabel("Files Found: None", 20, 290, 100, 20, $SS_SUNKEN + $SS_CENTER)
$manage_btn = GUICtrlCreateButton("Manage View", 20, 320, 100, 20)
$view_btn = GUICtrlCreateButton("View File", 140, 320, 100, 20)
$SciTE_btn = GUICtrlCreateButton("Open in SciTE", 260, 320, 100, 20)
$Run_btn = GUICtrlCreateButton("Run File", 380, 290, 100, 20)
$Exit_btn = GUICtrlCreateButton("Close", 380, 320, 100, 20)
GUISetState()

$filesgui = GUICreate("Script Finder", 500, 350, 0, 0, $WS_CHILD + $WS_BORDER, "", $maingui)
$Edit2 = GUICtrlCreateList("Searched File list", 20, 20, 460, 270, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_DISABLENOSCROLL, $WS_HSCROLL))
_GUICtrlListBox_SetHorizontalExtent($Edit2, 720)
$Search_btn = GUICtrlCreateButton("Search View", 20, 320, 100, 20)
$copy_btn = GUICtrlCreateButton("Copy File", 140, 320, 100, 20)
$rename_btn = GUICtrlCreateButton("Rename File", 260, 320, 100, 20)
$Delete_btn = GUICtrlCreateButton("Delete File", 380, 320, 100, 20)
$labelA = GUICtrlCreateLabel("Files Found with Phrase: None", 140, 290, 220, 20, $SS_SUNKEN + $SS_CENTER)
$label2A = GUICtrlCreateLabel("Files Found: None", 20, 290, 100, 20, $SS_SUNKEN + $SS_CENTER)
$Run_btnA = GUICtrlCreateButton("Run File", 380, 290, 100, 20)
GUISetState(@SW_HIDE)



While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Exit_btn
            Exit
        Case $msg = $browse_btn
            GUICtrlSetData($Status, "Selecting Folder to Search...")
            $find_loc = FileSelectFolder("Choose a Folder.", "")
            If $find_loc = "" Then ContinueLoop
            GUICtrlSetData($location, $find_loc)
            IniWrite(@ScriptDir & "\IE-library.ini", "search", "dir", $find_loc)
        Case $msg = $go_btn
            search_Folders()
            GUICtrlSetState($word_search, $GUI_FOCUS)
        Case $msg = $view_btn
            view()
        Case $msg = $copy_btn
            Set_Copy()
        Case $msg = $rename_btn
            Set_Rename()
        Case $msg = $Delete_btn
            Set_Delete()
        Case $msg = $Run_btn
            $TInfo = GUICtrlRead($Edit1)
            Set_Run($TInfo)
        Case $msg = $Run_btnA
            $TInfo = GUICtrlRead($Edit2)
            Set_Run($TInfo)
        Case $msg = $SciTE_btn
            open_SciTE()
        Case $msg = $manage_btn
            GUICtrlSetData($vStatus, "View: Manage Window")
            GUISetState(@SW_HIDE, $searchgui)
            GUISetState(@SW_SHOW, $filesgui)
            view_all()
        Case $msg = $Search_btn
            GUICtrlSetData($vStatus, "View: Search Window")
            GUISetState(@SW_HIDE, $filesgui)
            GUISetState(@SW_SHOW, $searchgui)
    EndSelect
    GUICtrlSetData($Status, "System is Ready...")
    Sleep(20)
WEnd

Func search_Folders()
    If Set_File() = -1 Then Return
    GUICtrlSetData($Status, "Searching for Files...")
    FileDelete(@TempDir & "\au3.txt")
    $Found = 0
    $Searched = 0
    $title = 0
    GUICtrlSetData($label, "Files Found with Phrase: " & $Found)
    GUICtrlSetData($labelA, "Files Found with Phrase: " & $Found)
    GUICtrlSetData($label2, "Files Found: " & $Searched)
    GUICtrlSetData($label2A, "Files Found: " & $Searched)
    GUICtrlSetData($Edit1, "")
    GUICtrlSetData($Edit2, "")
    $Temp_Dir = (GUICtrlRead($location))
    If $Temp_Dir = "" Then
        GUICtrlSetData($Status, "No Folder Selected...")
        MsgBox(262208, "Sorry", "No Folders Selected.   ", 2)
        Return
    EndIf
    If StringRight($Temp_Dir, 1) <> "\" Then $Temp_Dir = $Temp_Dir & "\"
    $Temp_Word = (GUICtrlRead($word_search))
    If GUICtrlRead($C_browse) = 1 Then
        GUICtrlSetData($Status, "Searching in Sub-Folders...PLEASE WAIT")
        RunWait(@ComSpec & ' /c ' & 'dir "' & $Temp_Dir & $Temp_File & '" /a :h /b /s' & ' > "' & @TempDir & '\au3.txt"', '', @SW_HIDE)
    Else
        GUICtrlSetData($Status, "Searching in Local Folder...")
        $FileList = _FileListToArray($Temp_Dir, $Temp_File, 1)
        If (Not IsArray($FileList)) Or (@error = 1) Then
            GUICtrlSetData($Status, "No Files Found...")
            MsgBox(262208, "Sorry", "No Files Found.", 2)
            Return
        EndIf
        $F_File = FileOpen(@TempDir & "\au3.txt", 2)
        For $x = 1 To $FileList[0]
            FileWriteLine($F_File, $Temp_Dir & $FileList[$x])
        Next
        FileClose($F_File)
    EndIf
    GUICtrlSetData($Status, "Listing...")
    If GUICtrlRead($R_title) = 1 Then
        $Temp_Word = (GUICtrlRead($title_search))
        $title = 1
    EndIf
    $hFile = FileOpen(@TempDir & "\au3.txt", 0)
    While 1
        $sLine = FileReadLine($hFile)
        If @error = -1 Then
            FileClose($hFile)
            Return
        EndIf
        $Temp_Dir = $sLine
        If $title = 0 Then $Temp_Search = FileRead($sLine, FileGetSize($sLine))
        If $title = 1 Then $Temp_Search = $sLine
        If StringInStr($Temp_Search, $Temp_Word) Then
            GUICtrlSetData($Edit1, $sLine, 1)
            $Found = $Found + 1
            GUICtrlSetData($label, "Files Found with Phrase: " & $Found)
            GUICtrlSetData($labelA, "Files Found with Phrase: " & $Found)
        EndIf
        $Searched = $Searched + 1
        GUICtrlSetData($label2, "Files Found: " & $Searched)
        GUICtrlSetData($label2A, "Files Found: " & $Searched)
        GUICtrlSetData($Status, "Searched:" & $sLine)
    WEnd
    FileClose($hFile)
EndFunc   ;==>search_Folders

Func view()
    GUICtrlSetData($Status, "Viewing in Notepad...")
    $Temp_Edit = GUICtrlRead($Edit1)
    $Temp_Word = (GUICtrlRead($word_search))
    If $Temp_Edit = "" Or $Temp_Edit = "Found File list" Then
        GUICtrlSetData($Status, "No File/Folder Selected...")
        MsgBox(262208, "Sorry", "No Files\Folders Selected.   ", 2)
        Return
    EndIf
    Run("notepad.exe " & $Temp_Edit)
    WinWaitActive("")
    If GUICtrlRead($R_title) = 1 Then Return
    GUICtrlSetData($Status, "Searching Notepad...")
    Sleep(200)
    Send("!EF")
    Sleep(200)
    Send($Temp_Word, 1)
    Sleep(200)
    Send("!f")
EndFunc   ;==>view

Func view_all()
    GUICtrlSetData($Status, "Viewing Manager window...")
    If Not FileExists(@TempDir & "\au3.txt") Then
        GUICtrlSetData($Status, "No Searches Were Completed...")
        MsgBox(262208, "Sorry", "No Files\Folders Searched.   ", 2)
        Return
    EndIf
    GUICtrlSetData($Edit2, "")
    $vFile = FileOpen(@TempDir & "\au3.txt", 0)
    While 1
        $vLine = FileReadLine($vFile)
        If @error = -1 Then ExitLoop
        GUICtrlSetData($Edit2, $vLine, 1)
        GUICtrlSetData($Status, "Setting Files: " & $vLine)
    WEnd
EndFunc   ;==>view_all

Func Set_Run(ByRef $TInfo)
    GUICtrlSetData($Status, "Setting up Run Command...")
    If $TInfo = "" Or $TInfo = "Found File list" Or $TInfo = "Searched File list" Then
        GUICtrlSetData($Status, "No File Selected to Run...")
        MsgBox(262208, "Sorry", "No Run File was Selected.   ", 2)
        Return
    EndIf
    If GUICtrlRead($R_[6]) = 1 And StringInStr($TInfo, ".au3") = 0 Then
        GUICtrlSetData($Status, "Running File...")
        $TInfo = FileGetShortName($TInfo)
        ShellExecute($TInfo)
        $TInfo = ""
        Return
    EndIf
    If StringInStr($TInfo, ".au3") = 0 Then
        GUICtrlSetData($Status, "File Not an Au3 Type...")
        MsgBox(262208, "Sorry", "Run File was NOT an *au3* Type.   " & @CRLF & @CRLF & "Opening File in Notepad   ", 2)
        GUICtrlSetData($Status, "Viewing in Notepad...")
        Run("notepad.exe " & $TInfo)
        $TInfo = ""
        Return
    EndIf
    $TInfo = FileGetShortName($TInfo)
    GUICtrlSetData($Status, "Running File...")
    RunWait($Program_2 & " " & $TInfo)
    $TInfo = ""
EndFunc   ;==>Set_Run

Func Set_Copy()
    GUICtrlSetData($Status, "Setting up Copy...")
    $CInfo = GUICtrlRead($Edit2)
    If $CInfo = "" Or $CInfo = "Found File list" Or $CInfo = "Searched File list" Then
        GUICtrlSetData($Status, "No File Selected to Copy...")
        MsgBox(262208, "Sorry", "No Copy File was Selected.   ", 2)
        Return
    EndIf
    GUICtrlSetData($Status, "Find Destination Folder...")
    $Linfo = FileSelectFolder("Choose a Destination Folder.", "")
    If $Linfo = "" Then
        GUICtrlSetData($Status, "No Folder Selected...")
        MsgBox(262208, "Sorry", "No Destination Folder was Selected.   ", 2)
        Return
    EndIf
    $NInfo = StringSplit($CInfo, "\")
    $NInfo = $Linfo & "\" & $NInfo[$NInfo[0]]
    GUICtrlSetData($Status, "Checking if file exists...")
    If FileExists($NInfo) Then
        $iMsgBoxAnswer = MsgBox(262212, "Overwrite Existing File?", "The File " & $NInfo & " was found    " & @CRLF & @CRLF & "Over-Write File?")
        If $iMsgBoxAnswer = 7 Then
            Return
        EndIf
    EndIf
    GUICtrlSetData($Status, "Copying File...")
    $var1 = FileCopy($CInfo, $NInfo, 1)
    If $var1 = 1 Then
        MsgBox(262208, "Success", "The file was Copied   ", 2)
    Else
        MsgBox(262208, "Fail", "The file was NOT Copied   ", 2)
    EndIf
EndFunc   ;==>Set_Copy

Func Set_Rename()
    GUICtrlSetData($Status, "Setting Rename File...")
    $RInfo = GUICtrlRead($Edit2)
    If $RInfo = "" Or $RInfo = "Found File list" Or $RInfo = "Searched File list" Then
        GUICtrlSetData($Status, "No File Selected...")
        MsgBox(262208, "Sorry", "No Rename File was Selected.   ", 2)
        Return
    EndIf
    GUICtrlSetData($Status, "Prompt for FileName...")
    $Minfo = InputBox("Rename File", "Please Type a New FileName. ", "", "", -1, 150)
    If $Minfo = "" Then
        GUICtrlSetData($Status, "No Name Given...")
        MsgBox(262208, "Sorry", "No File Name was Selected.   ", 2)
        Return
    EndIf
    $result = StringInStr($RInfo, "\", 0, -1)
    $NInfo = StringLeft($RInfo, $result) & $Minfo & StringRight($Temp_File, 4)
    GUICtrlSetData($Status, "Checking if File Exists...")
    If FileExists($NInfo) Then
        $iMsgBoxAnswer = MsgBox(262212, "Overwrite Existing File?", "The File " & $NInfo & " was found    " & @CRLF & @CRLF & "Over-Write File?")
        If $iMsgBoxAnswer = 7 Then
            Return
        EndIf
    EndIf
    GUICtrlSetData($Status, "Renaming File...")
    $var1 = FileMove($RInfo, $NInfo, 1)
    If $var1 = 1 Then
        FileDelete($RInfo)
        MsgBox(262208, "Success", "The file was Renamed   ", 2)
    Else
        MsgBox(262208, "Fail", "The file was NOT Renamed   ", 2)
    EndIf
    $ret = _GUICtrlListBox_FindString($Edit2, $RInfo, 1)
    If ($ret == $LB_ERR) Then
        MsgBox(16, "Error #1", "Unknown error from _GUICtrlListBox_FindString")
    Else
        $ret2 = _GUICtrlListBox_DeleteString($Edit2, $ret)
        If ($ret2 == $LB_ERR) Then
            MsgBox(16, "Error #2", "Unknown error from _GUICtrlListDeleteItem")
        EndIf
    EndIf
EndFunc   ;==>Set_Rename

Func Set_Delete()
    GUICtrlSetData($Status, "Setting up Delete...")
    $DInfo = GUICtrlRead($Edit2)
    If $DInfo = "" Or $DInfo = "Found File list" Or $DInfo = "Searched File list" Then
        GUICtrlSetData($Status, "No File Selected...")
        MsgBox(262208, "Sorry", "No Delete File was Selected.   ", 2)
        Return
    EndIf
    GUICtrlSetData($Status, "Verify that File Exists...")
    If FileExists($DInfo) Then
        $iMsgBoxAnswer = MsgBox(262212, "Confirm - Delete File?", "The File " & $DInfo & " was found    " & @CRLF & @CRLF & "Delete File?")
        If $iMsgBoxAnswer = 7 Then
            Return
        EndIf
    EndIf
    GUICtrlSetData($Status, "Deleting File...")
    $var1 = FileDelete($DInfo)
    If $var1 = 1 Then
        MsgBox(262208, "Success", "The file was Deleted   ", 2)
    Else
        MsgBox(262208, "Fail", "The file was NOT Deleted   ", 2)
    EndIf
    $ret = _GUICtrlListBox_FindString($Edit2, $DInfo, 1)
    If ($ret == $LB_ERR) Then
        MsgBox(16, "Error #1", "Unknown error from _GUICtrlListBox_FindString")
    Else
        $ret2 = _GUICtrlListBox_DeleteString($Edit2, $ret)
        If ($ret2 == $LB_ERR) Then
            MsgBox(16, "Error #2", "Unknown error from _GUICtrlListDeleteItem")
        EndIf
    EndIf
EndFunc   ;==>Set_Delete

Func Set_File()
    GUICtrlSetData($Status, "Checking File Type...")
    For $t = 1 To $Temp_Type[0]
        If GUICtrlRead($R_[$t]) = 1 Then
            If $t = $Temp_Type[0] Then
                $Read_Temp = GUICtrlRead($R_Input)
                If $Read_Temp = "" Or StringInStr($Read_Temp, ".") = 0 Then
                    GUICtrlSetData($Status, "No File Type Selected...")
                    MsgBox(262208, "Sorry", "No File Type Selected.   " & @CRLF & "Example .exe or .dll    ", 5)
                    Return -1
                EndIf
                $Temp_File = "*" & $Read_Temp
            Else
                $Temp_File = "*" & $Temp_Type[$t]
            EndIf
            Return
        EndIf
    Next
EndFunc   ;==>Set_File

Func open_SciTE()
    GUICtrlSetData($Status, "Setting up SciTE...")
    $Temp_Edit = GUICtrlRead($Edit1)
    If $Temp_Edit = "" Or $Temp_Edit = "Found File list" Then
        GUICtrlSetData($Status, "No File Selected for SciTE...")
        MsgBox(262208, "Sorry", "No Files\Folders Selected.   ", 2)
        Return
    EndIf
    GUICtrlSetData($Status, "Checking for Au3 File...")
    If StringInStr($Temp_Edit, ".au3") = 0 Then
        $iMsgBoxAnswer = MsgBox(262212, "Verify File Type", "The File " & $Temp_Edit & " is NOT an *au3* Type.    " & @CRLF & @CRLF & "Open in SciTE.exe?")
        If $iMsgBoxAnswer = 7 Then
            Return
        EndIf
    EndIf
    GUICtrlSetData($Status, "Check if SciTE is Running...")
    If ProcessExists("SciTE.exe") Then MsgBox(262208, "SciTE is Running", "Placing File in Scite.exe   ", 2)
    GUICtrlSetData($Status, "Running SciTE Now...")
    $file_name = FileGetShortName($Temp_Edit)
    $Editor = RegRead("HKCR\AutoIt3Script\Shell\Edit\Command", "")
    $Splitor = StringSplit($Editor, '"')
    If FileExists($Splitor[2]) Then Run(StringReplace($Editor, "%1", $file_name))
EndFunc   ;==>open_SciTE

Func endscript()
    MsgBox(262208, "Thanks", "... Valuater   ", 1)
    FileDelete(@TempDir & "\au3.txt")
EndFunc   ;==>endscript

Enjoy!!!

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Line 265, 299, 332:

MsgBox(262208,, "Fail", "The file was NOT Copied ", 2)

Get rid of the extra comma before "fail"

Heh - copied and pasted a faulty line. Nice.

One more thing - @programfilesdir isn't always accurate. I use D: drive, that obviously checks for C: (use reg key in addition?)

Other than that, impressive. I like it.

Link to comment
Share on other sites

This is very cool, awesome comes to mind.

I agree w/ @greenmachine about @ProgramFilesDir, mine is on C: but most Apps. are installed on K:, so the registry would be better.

Until I commented line 174 (FileClose($hFile)) it failed on every run, apparently because line 157 had already run.

I wish the radio buttons were check boxes and that the controls for $location, $word_search, and $title_search were Combos with "memory". I guess I didn't give you quite enough time, huh? :lmao:;)

Even if you don't want to do the combos, it would be nice if each use of "Browse for Folder" started at the last destination.

About the features on the "Manage" GUI, If you combined Copy and Rename to one button "Copy/Rename" the user would have the option of doing either or both in the same operation.

I like the Status message in the Status Bar but it was truncated on the right and all the text on the Status Bar was clipped on the bottom. Maybe Status Bar height should be related to the system font height? The checkbox label "All Sub-Folders" was truncated at the "e".

When I searched a whole drive, Files Found gave no count, I couldn't tell if it was truncated or not. Files Found with Phrase did give a count.

This may look like a bunch of grousing, but that is not my intent. My first statement is sincere.

Gene o:)

Advanced from the Simple Script Finder

#include <GuiConstants.au3>
#Include <File.au3>
#Include <Array.au3>
#Include <GuiList.au3>


$Run_btnA = GUICtrlCreateButton("Run File", 380, 290, 100, 20) 
GUISetState(@SW_HIDE)

{Snipped}


Func endscript()
    MsgBox(262208,"Thanks","... Valuater   ", 1)
    FileDelete(@TempDir & "\au3.txt")
EndFunc

8)

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Link to comment
Share on other sites

1

i try to stay out of the registry....I really dont like other programs entering MY registry

... mabe i should'nt be so closed minded ( besides, i thought @prgrmfledir would know where to look )

2

$hFile = FileOpen(@TempDir & "\au3.txt", 0)
    While 1
        $sLine = FileReadLine($hFile)
        If @error = -1 Then 
            FileClose($hFile)************* LINE 157 if error, close file & exit loop
            ExitLoop
        EndIf
        $Temp_Dir = $sLine
        If $title = 0 Then $Temp_Search = FileRead($sLine, FileGetSize($sLine))
        If $title = 1 Then $Temp_Search = $sLine
        If StringInStr($Temp_Search, $Temp_Word) Then
            GUICtrlSetData($Edit1, $sLine, 1)
            $Found = $Found + 1
            GUICtrlSetData($label, "Files Found with Phrase: " & $Found)
            GUICtrlSetData($labelA, "Files Found with Phrase: " & $Found)
        EndIf
        $Searched = $Searched + 1
        GUICtrlSetData($label2, "Files Found: " & $Searched)
        GUICtrlSetData($label2A, "Files Found: " & $Searched)
        GUICtrlSetData( $status, "Searched:" & $sLine)  
    WEnd
    FileClose($hFile) ************** LINE 174 ... not used much, i can see, no error on mine??

3

Even if you don't want to do the combos, it would be nice if each use of "Browse for Folder" started at the last destination.

I completely agree with that...

4

Maybe Status Bar height should be related to the system font height?

i guess your right... the pic on the first post shows no problem for me ( i could set the font IN the GUI too )

5

When I searched a whole drive, Files Found gave no count

I tried numerous times and got a count for the entire drive.... dunno????

Thanks Gene.... I will look into making it better soon ( doing another project now)

8)

I can see that LINE 158 should be "Return"... i will fix the first post now

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

1

i try to stay out of the registry....I really dont like other programs entering MY registry

... mabe i should'nt be so closed minded ( besides, i thought @prgrmfledir would know where to look )

We we weren't suggesting that you change anything, just that you read the one that says were AutoIt is. I still haven't ever programatically changed the registry myself, but I have started to look to see what is there if I need to know.

2

$hFile = FileOpen(@TempDir & "\au3.txt", 0)
    While 1
        $sLine = FileReadLine($hFile)
        If @error = -1 Then 
            FileClose($hFile)************* LINE 157 if error, close file & exit loop
            ExitLoop
        EndIf
        $Temp_Dir = $sLine
        If $title = 0 Then $Temp_Search = FileRead($sLine, FileGetSize($sLine))
        If $title = 1 Then $Temp_Search = $sLine
        If StringInStr($Temp_Search, $Temp_Word) Then
            GUICtrlSetData($Edit1, $sLine, 1)
            $Found = $Found + 1
            GUICtrlSetData($label, "Files Found with Phrase: " & $Found)
            GUICtrlSetData($labelA, "Files Found with Phrase: " & $Found)
        EndIf
        $Searched = $Searched + 1
        GUICtrlSetData($label2, "Files Found: " & $Searched)
        GUICtrlSetData($label2A, "Files Found: " & $Searched)
        GUICtrlSetData( $status, "Searched:" & $sLine)  
    WEnd
    FileClose($hFile) ************** LINE 174 ... not used much, i can see, no error on mine??
I didn't mean that line 174 was wrong, it was just the next stop after line 158 and the file was already closed by line 157.

3

I completely agree with that...

;)

4

i guess your right... the pic on the first post shows no problem for me ( i could set the font IN the GUI too )

I think that would be good, many people change the system defaults. There are a couple of MS Access report properties that could be handy in Windows generally. They're "Can Grow" and "Can Shrink". They let a data line grow or shrink to fit the data actually there.

5

I tried numerous times and got a count for the entire drive.... dunno????

I think that if the number of files returned by the Dir command is large enough, the variable holding the number is truncated and only the text literal displayed. An alternative is, since the field showing the count is not editable, skip the field and make both the text literal and the variable the caption of a label control and the same with other literal + variable situations.

Thanks Gene.... I will look into making it better soon ( doing another project now)

8)

I can see that LINE 158 should be "Return"... i will fix the first post now

o:)

Thanks for your time and effort.

Gene :lmao:

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Link to comment
Share on other sites

1

i try to stay out of the registry....I really dont like other programs entering MY registry

... mabe i should'nt be so closed minded ( besides, i thought @prgrmfledir would know where to look )

The registry is a resource of information that you are going to need to read from to make applications as you do work correctly. I think this function may help you to take the step towards locating the AutoIt Beta Directory. I just modded it from an older function to be more standard with dual version support. Perhaps this may make your application more successful with everyone's different installation setup with AutoIt.

MsgBox(0, 'AutoIt Directory returned', _DirAutoIt('Beta'))

Func _DirAutoIt($version = 'Prod')
    Switch $version
        Case 'Prod'
            Switch True
                Case FileExists(@ProgramFilesDir & '\AutoIt3')
                    Return @ProgramFilesDir & '\AutoIt3'
                Case RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir')
                    Return RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir')
            EndSwitch
        Case 'Beta'
            Switch True
                Case FileExists(@ProgramFilesDir & '\AutoIt3\Beta')
                    Return @ProgramFilesDir & '\AutoIt3\Beta'
                Case RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir')
                    Return RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir')
            EndSwitch
    EndSwitch
    If $version = 'Prod' Then $version = 'Public Release'   
    Return FileSelectFolder('Locate AutoIt Directory  (' & $version & ' version)', @HomeDrive)
EndFunc

Requires Beta as your script is. :lmao:

Edited by MHz
Link to comment
Share on other sites

  • 4 weeks later...

UpDated - Ver 1.0.2 - Feb 18, 2006

Fixed - Font size

Fixed - Location of Beta

Fixed - Remember last "Browse for Folder" location

minor bugs

Thanks greenmachine, Gene, MHz, HHCory for the reviews... and gafrost for script help

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

When I beta ran it from Scite, I got the following Au3Check errors:

K:\_Documents\_Dev\OtherCode\Valuator\Script-n-Text Mgr.Au3(315,23) : ERROR: syntax error

MsgBox(262208,,

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

K:\_Documents\_Dev\OtherCode\Valuator\Script-n-Text Mgr.Au3(315,65) : ERROR: MsgBox() [built-in] called with wrong number of args.

MsgBox(262208,, "Fail", "The file was NOT Renamed ", 2)

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

K:\_Documents\_Dev\OtherCode\Valuator\Script-n-Text Mgr.Au3(348,23) : ERROR: syntax error

MsgBox(262208,,

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

K:\_Documents\_Dev\OtherCode\Valuator\Script-n-Text Mgr.Au3(348,65) : ERROR: MsgBox() [built-in] called with wrong number of args.

MsgBox(262208,, "Fail", "The file was NOT Deleted ", 2)

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

K:\_Documents\_Dev\OtherCode\Valuator\Script-n-Text Mgr.Au3 - 4 error(s), 0 warning(s)

I fixed a couple of doubled commas in MsgBoxes & it ran OK. I do have a few more suggestions.

The following items relate to the attached screen shots:

A & B - I suspect the loss of the "r" and the bottom of the word "Type" is due to your default font size being different from mine.

C - In the first Screen Shot you can see how many files were found in the second you cannot. I expect it is due to there being more than 3 digits.

D - The status bar is too short to display all the text there.

A, B & D are merely cosmetic, C is not.

A different issue: if the whole thing were a little wider, you could add another radio button for "Other" and when selected, popup an Input box to get the user's choice of any other extension. Of course if it was a little wider it would be easier to address

A - D too. :geek:

Gene :o

Edit: Oops, I missed your note on font size, I guess that puts the cause of A & B up for grabs.

UpDated - Ver 1.0.2 - Feb 18, 2006

Fixed - Font size

Fixed - Location of Beta

Fixed - Remember last "Browse for Folder" location

minor bugs

Thanks greenmachine, Gene, MHz, HHCory for the reviews... and gafrost for script help

8)

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Link to comment
Share on other sites

  • Moderators

Ha, I had never seen this before, I made a phrase finder about a month ago that I can't live without, I have so many .au3 / .txt / .ini files that I use, sometimes I forget what file I need, and which my functions are in, tells the file name, what line the phrase was found on so makes my long elagated times of searching just a click of a button away. Of course it's for personal use, so my GUI is no where as nice as yours!! :o.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hi,

This is useful, thanks.

Nothing appears to happen if I am in a huge directory, though; I can't see why?..

Randall

If there are more than 999 files found, the number is truncated and the Files Found field just shows "Files Found:".

Click the Manage View button.

Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Link to comment
Share on other sites

Yes, you're right, that is with XP. That's why I included the second screen shot in my post on "Feb 18 2006, 08:31 PM". It shows that files were found, but the Files Found shows none. I'm running Win2K, I don't expect ever to use XP, maybe the next version. :o

Gene

no problem here??????

?????

8)

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Link to comment
Share on other sites

Hi,

Would you find it useful to see filelines as well as an option?

[double click in new GUI just brings up explorer though; exit to go back to yours...]

Best, Randall

[needs SQL UDF ]

Thats pretty sharp... lots of work went into your SQL UDF

wish i understood half of it

Nice job ... randallc

8)

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...