CyberSlug Posted March 23, 2005 Share Posted March 23, 2005 I'm annoyed that Windows does not let you save the RESULTS of a file search. Pretty straight forward usage of ControlListView. Lots of room for enhancement such as Excel integration.... ; CyberSlug - 23 March 2004 ; ; After you do a file search, this lets you copy the results at tab-delimted text Const $title = "Search Results" Const $notepadTitle = "Untitled - Notepad" $RowCount = ControlListView ($title,"", "SysListView321", "GetItemCount") $ColCount = ControlListView ($title,"", "SysListView321", "GetSubItemCount") $results = "" For $row = 0 to $RowCount-1 For $col = 0 to $ColCount-1 $results = $results & ControlListView ($title,"", "SysListView321","GetText", $row, $col) & @TAB Next $results = $results & @CRLF Next Run("notepad") WinWait($notepadTitle) ControlSetText($notepadTitle,"","Edit1", $results) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Ejoc Posted March 23, 2005 Share Posted March 23, 2005 Cool Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
CyberSlug Posted March 24, 2005 Author Share Posted March 24, 2005 (edited) While I'm at it, here's a viewer for the above script's output.... Try the right-click menu Sample file attached.expandcollapse popup;CyberSlug - 23 March 2005 ; ;Viewer for search results ;NOTE: I do not see an easy way to read the SysHeader32 control.... ; If your Windows Search results has different columns, then you would need to change the code below #include <GUIConstants.au3> Dim $filename = @ScriptDir & "\SampleSearchResults.txt" If $CmdLine[0] > 0 Then $filename = $CmdLine[1] $GUI = GUICreate("Viewer for Search Results",400, 300, -1, -1, $WS_THICKFRAME) $listview = GUICtrlCreateListView ("Name|In Folder|Size|Type|Date Modified",0,0,400,280) $contextMenu = GuiCtrlCreateContextMenu($listview) $infoitem = GUICtrlCreateMenuitem ("Open containing folder...",$contextMenu) $file = FileOpen($filename, 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open specified search results file...") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop GUICtrlCreateListViewItem(StringReplace($line,@TAB,"|"),$listview) Wend FileClose($file) GUICtrlCreateContextMenu () GUISetState() ;;;ControlSend($GUI, "", "SysListView321", "^{NUMPADADD}");doesn't work WinWaitActive($GUI) Send("^{NUMPADADD}"); resizes columns to show all items fully Do $msg = GUIGetMsg () If $msg = $infoItem Then $data = StringSplit(GuiCtrlRead(GuiCtrlRead($listview)), "|") If UBound($data) >= 2 Then Run("explorer /select," & """" & $data[2] & "\" & $data[1] & """") EndIf EndIf Until $msg = $GUI_EVENT_CLOSESampleSearchResults.txt Edited March 24, 2005 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Alterego Posted March 24, 2005 Share Posted March 24, 2005 just rewrite their entire lame search engine...couldn't take more than half an hour =) This dynamic web page is powered by AutoIt 3. Link to comment Share on other sites More sharing options...
vatobeto Posted June 10, 2007 Share Posted June 10, 2007 (edited) While I'm at it, here's a viewer for the above script's output.... Try the right-click menu Sample file attached.expandcollapse popup;CyberSlug - 23 March 2005 ; ;Viewer for search results ;NOTE: I do not see an easy way to read the SysHeader32 control.... ; If your Windows Search results has different columns, then you would need to change the code below #include <GUIConstants.au3> Dim $filename = @ScriptDir & "\SampleSearchResults.txt" If $CmdLine[0] > 0 Then $filename = $CmdLine[1] $GUI = GUICreate("Viewer for Search Results",400, 300, -1, -1, $WS_THICKFRAME) $listview = GUICtrlCreateListView ("Name|In Folder|Size|Type|Date Modified",0,0,400,280) $contextMenu = GuiCtrlCreateContextMenu($listview) $infoitem = GUICtrlCreateMenuitem ("Open containing folder...",$contextMenu) $file = FileOpen($filename, 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open specified search results file...") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop GUICtrlCreateListViewItem(StringReplace($line,@TAB,"|"),$listview) Wend FileClose($file) GUICtrlCreateContextMenu () GUISetState() ;;;ControlSend($GUI, "", "SysListView321", "^{NUMPADADD}");doesn't work WinWaitActive($GUI) Send("^{NUMPADADD}"); resizes columns to show all items fully Do $msg = GUIGetMsg () If $msg = $infoItem Then $data = StringSplit(GuiCtrlRead(GuiCtrlRead($listview)), "|") If UBound($data) >= 2 Then Run("explorer /select," & """" & $data[2] & "\" & $data[1] & """") EndIf EndIf Until $msg = $GUI_EVENT_CLOSE I know this is a l a t e post, but just found it. I modified your viewer, to use file open dialog to locate search result file, so you're not locked into one location/filename. Good idea - always hated that inability to save the results, and I'm way too lazy to rewrite the search program. vatobeto.WindowsSearchViewer.au3 Edited June 10, 2007 by vatobeto Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now