Sign in to follow this  
Followers 0
SlimShady

Search For Files And Folders

23 posts in this topic

#1 ·  Posted (edited)

I made this script because I wanted a quicker way to search for files:

A replacement for Windows File Search.

If you start the script, it will ask you what you want and which words/characters to search for.

You can search for all keywords using spaces between the words;

Example:

elton john .mp3

That will match all mp3 files with elton john in the filename or path.

You can search for any (or some) keywords using the first word as 'any';

Example:

any james .doc

It will find any files that contain either james OR have the extension .doc OR both.

You can search for files with the method OR. using the character "|";

Example:

.mp3|.wav|.wma

That will match all files that are .mp3 OR .wav OR .wma.

After that you can choose in which drive/folder to search for.

If there are no matches you will be shown and it will be written in results.txt

Features:

  • last search is saved, on startup it will be filled in the inputbox.
  • a progressbar when it's searching
  • locate the file automatically by answering a dialog if you want to

    (see beginning of the script)

  • You can automatically create a batch file that moves the files to

    a folder you specify at startup

Known issues:
  • none
Here it is, enjoy:

...http://neoangelo.3x.ro/scripts/Search.au3...

(copy/paste above link in a new browser page)

Edited by SlimShady

Share this post


Link to post
Share on other sites



EDIT: First post updated.
  • Bugfix: When there are no results you would be not be told correctly
  • Minor bugfixes

Share this post


Link to post
Share on other sites

Really nice, SlimShady !

Quite useful if you for example wanna list every song of...Deftones in a folder.

Hey, even sub-folders ! :D

Keep on the good work !

Share this post


Link to post
Share on other sites

Very Nice.

Is there any way to include * wildcard in the search so you can look for part of the word instead of the whole word ?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If you want to search for a part, enter just the part; example:

Elton .mp3

It will match all Elton John mp3s example. So you wouldn't have to enter Elton John .mp3

I'm now creating

- the ability to exclude words: Easy.

- the ability to search using the OR operator. That will be the "|" character.

Example: "elton john |.mp3|.wav|.wma"

- some extra functions (any ideas?): MoveAllMatches. You will get the ability to choose a folder to move the matches to.

I'm gonna start working on the new features right now.

Edited by SlimShady

Share this post


Link to post
Share on other sites

Sounds great !

But is there any way for searching for for a certain filetype..

For example mp3..

Would that be :

" |.mp3"

?

Share this post


Link to post
Share on other sites

Just:

.mp3

Share this post


Link to post
Share on other sites

Ok !

Thanks !

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I've got a problem. My For... doesn't work anymore.

I replaced the For... with While...WEnd.

It says:

Error: "Wend" statement with no matching "While" statement

The same thing with For....

(Problem solved.)

Edited by SlimShady

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

just processed your script with Tidy and you can easely see that you are missing an endif........this is the output:

Func SearchAND($READLINE)
   $FOUNDNUM = 0
   
  ;======Start MultiWords
   If $MULTIWORDS = "Yes" Then
      
    ;=====Start searching each word
      $NUM = 1
      
      While $I <= $WORDS[0]
        ;=====Check match
         $FOUND = StringInStr($READLINE, $WORDS[$NUM])
         
         If $IGNORE[0] > 0 Then
            $NUM = $IGNORE[0] + 1
            
            $IGNORE[$NUM] = StringInStr($READLINE, "Temporary Internet Files")
            
            $EXC = 1
            Do
               $IGNORE = StringInStr($READLINE, $IGNORE[$EXC])
              ;=======Ignore certain words
               If $IGNORE > 0 Then $FOUND = 0
               $EXC = $EXC + 1
            Until $EXC = $IGNORE[0]
            
            If $FOUND > 0 Then
               $FOUNDNUM = $FOUNDNUM + 1
            EndIf
            
          ;========End searching for words
            $I = $I + 1
         Wend
         
         If $FOUNDNUM = $WORDS[0] Then
            $FOUND = 1
            $FOUNDSOMETHING = "yes"
         Else
            $FOUND = 0
         EndIf
         
        ;=======If not MultiWords.........
      Else
         
        ;=====Check match
         $FOUND = StringInStr($READLINE, $WORDS)
         
         $IGNORE = StringInStr($READLINE, "Temporary Internet Files")
         
         If $IGNORE > 0 Then $FOUND = 0
         
      EndIf
   EndFunc  ;==>SearchAND
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#11 ·  Posted

Thanks it works. :D

Share this post


Link to post
Share on other sites

#12 ·  Posted

* I cleaned the script using AutoIt Tidy

* Lot's of bugfixes

* I tried to create the exclude feature but I just can't get it work, so I deleted it. I will recreate it when I'm thinking clear.

* I'll work on this when I get home (an hour from now)

Share this post


Link to post
Share on other sites

#13 ·  Posted

Added full functionality to search for any keyword.

So you can enter some keywords, if it matches one, it saves the line.

If it matches multiple keywords in one line, it saves the line too.

I can't get the exclude thing to work. I'm stuck.

I get an error; I tried anything, but no luck. It's still in the script.

See first post.

Share this post


Link to post
Share on other sites

#14 ·  Posted

Updated. For all functionalities see first post.

Share this post


Link to post
Share on other sites

#15 ·  Posted

- Solved problem with progressbar.

Share this post


Link to post
Share on other sites

- Added ability to list search results in a listbox,

with buttons that do the following with the selected file:

Copy filepath to clipboard

Locate the file

Run file

Share this post


Link to post
Share on other sites

Seems you have meet your upload limit on lycos...care to just code it in here?

Share this post


Link to post
Share on other sites

Seems you have meet your upload limit on lycos...care to just code it in here?

Too much traffic...

I've uploaded it to another place:

...http://neoangelo.3x.ro/scripts/Search.au3...

Copy/paste in a new browser page to download it.

Share this post


Link to post
Share on other sites

Hello!

Someone could pass me the script? (Is no longer online ...)

Thank you!

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

yes could you give it to us please :D

aub? :P

Edited by timgames

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