lekremyelsew Posted March 7, 2006 Share Posted March 7, 2006 Hey, kinda newbie here. I am trying to create a script that will search your computer for files. I havent taken the time to make ;comments yet. I'm trying to find out how to to use FileFindNextFile to search subfolders for files. If there is another command I need to use I'm listening. Also If I can make the script simpler, tell me expandcollapse popup#include <GUIConstants.au3> FileInstall("C:\Documents and Settings\wmerkel\Desktop\Programming\FindIt.ico", @TempDir) GUICreate("FindIt!", 313, 161, 348, 272) $search_title = GUICtrlCreateInput("Whatever", 8, 16, 233, 21, -1, $WS_EX_CLIENTEDGE) $FindIt = GUICtrlCreateButton("Find It", 256, 8, 40, 40, BitOR($BS_DEFPUSHBUTTON,$BS_ICON)) $dir_mydocs = GUICtrlCreateRadio("My Documents", 16, 72, 97, 17) $dir_all = GUICtrlCreateRadio("Entire System", 16, 88, 89, 17) $dir_user = GUICtrlCreateRadio("Custom Directory", 16, 104, 105, 17) $cust_path = GUICtrlCreateInput("None", 16, 128, 193, 21, $ES_READONLY, $WS_EX_CLIENTEDGE) $browse_button = GUICtrlCreateButton("...", 210, 128, 25, 21) GUICtrlCreateGroup("Path", 8, 56, 289, 97) GUISetIcon(@TempDir & "\Findit.ico") GUICtrlSetImage($FindIt, @TempDir & "\Findit.ico") GUICtrlSetState($browse_button, $GUI_DISABLE) GUICtrlSetState($dir_mydocs, $GUI_CHECKED) GUICtrlSetState($cust_path, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $FindIt Call("Search") Case $msg = $browse_button Call("Browse") Case $msg = $dir_user GUICtrlSetState($cust_path, $GUI_ENABLE) GUICtrlSetState($browse_button, $GUI_ENABLE) Case $msg = $dir_all GUICtrlSetState($cust_path, $GUI_DISABLE) GUICtrlSetState($browse_button, $GUI_DISABLE) Case $msg = $dir_mydocs GUICtrlSetState($cust_path, $GUI_DISABLE) GUICtrlSetState($browse_button, $GUI_DISABLE) EndSelect WEnd Exit Func Browse() $cust_path_select = FileSelectFolder("Custom Folder","C:\") & "\" GUICtrlSetData($cust_path, $cust_path_select) EndFunc Func Search() GUICtrlRead($browse_button) GUICtrlRead($cust_path) GUICtrlRead($dir_all) GUICtrlRead($dir_mydocs) GUICtrlRead($dir_user) GUICtrlRead($search_title) GUICreate("SearchIt!", 297, 92, 352, 253) $scan_prog = GUICtrlCreateProgress(8, 32, 273, 25) $scan_cancel = GUICtrlCreateButton("Cancel", 112, 64, 57, 24) GUISetIcon("C:\Documents and Settings\wmerkel\Desktop\Programming\SearchIt!\FindIt.ico") GUICtrlSetColor($scan_prog, 0x00FFFF) GUICtrlCreateLabel("Searching For", 32, 8, 70, 17) GUISetState(@SW_SHOW) $scan_prog_num = -1 FileFindFirstFile $msg = GuiGetMsg() While 1 Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $scan_cancel ExitLoop Case $msg = $msg $scan_prog_num = $scan_prog_num + 1 GUICtrlSetData($scan_prog, $scan_prog_num) FileFindNextFile EndSelect WEnd Exit EndFunc Hot Corners Rulez! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 7, 2006 Moderators Share Posted March 7, 2006 (edited) Valauter has made a few of these... They are in scripts and scraps... take a peak, should help you out on your own project... or since it's made, you might just want to use his.Here's one here: http://www.autoitscript.com/forum/index.ph...59&hl=Valuater# Edited March 7, 2006 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 More sharing options...
seandisanti Posted March 7, 2006 Share Posted March 7, 2006 Valauter has made a few of these... They are in scripts and scraps... take a peak, should help you out on your own project... or since it's made, you might just want to use his.Here's one here: http://www.autoitscript.com/forum/index.ph...59&hl=Valuater#there are a few recursive scripts for file listing (like mine) etc... someone will probably tell you that the fastest and easiest way would be to use a 'dir /s filename.ext' from command line, and parse the output... Link to comment Share on other sites More sharing options...
Valuater Posted March 7, 2006 Share Posted March 7, 2006 there are a few recursive scripts for file listing (like mine) etc... someone will probably tell you that the fastest and easiest way would be to use a 'dir /s filename.ext' from command line, and parse the output...that actual command line ... and FileListtoArrayare both in my search engines8) Link to comment Share on other sites More sharing options...
lekremyelsew Posted March 8, 2006 Author Share Posted March 8, 2006 Well Guys thanx alot for the suggestions, but the script wont work on my computer. Could i have an .exe file purdy pleese... Hot Corners Rulez! Link to comment Share on other sites More sharing options...
Valuater Posted March 8, 2006 Share Posted March 8, 2006 you probably need beta... if you have it you need to press "Tools > Run Beta" from Scite Editor 8) Link to comment Share on other sites More sharing options...
lekremyelsew Posted March 8, 2006 Author Share Posted March 8, 2006 "Beta Run" wont work But i have an idea If someone could tell how i could transfer data from .ahk to .au3 scripts withouut it being Oh So Obvious. Registry? Hot Corners Rulez! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 8, 2006 Moderators Share Posted March 8, 2006 "Beta Run" wont workBut i have an ideaIf someone could tell how i could transfer data from .ahk to .au3 scripts withouut it being Oh So Obvious.Registry? What does that mean? Translate .ahk to .au3? 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 More sharing options...
lekremyelsew Posted March 9, 2006 Author Share Posted March 9, 2006 I use AutoHotkey and AutoIt.I know that the "Loop (files and folders)" commad will be able to get the names of the files, but how do transfer data from %AutoHotkey% variables to to $AutoIt vars Hot Corners Rulez! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 9, 2006 Moderators Share Posted March 9, 2006 You could use an .ini file and condition statements... Maybe if they have console write you could use StderrRead/StdOutRead/StdOutWrite... Personally, I know nothing of them, and or how their script works... the syntax I've seen seems like the ancient AutoIt v2 version (wonder why), but I still have never even downloaded their program. 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 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