Sign in to follow this  
Followers 0
lekremyelsew

Search

10 posts in this topic

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 :geek:

#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

:o

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

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...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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 FileListtoArray

are both in my search engines

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Well Guys thanx alot for the suggestions, but the script wont work on my computer. Could i have an .exe file purdy pleese... :o

Share this post


Link to post
Share on other sites

you probably need beta... if you have it

you need to press "Tools > Run Beta" from Scite Editor

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

"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? :o

Share this post


Link to post
Share on other sites

"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? :o

What does that mean? Translate .ahk to .au3?

[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :o (wonder why), but I still have never even downloaded their program.


[center]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.[/center]

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