Guest skiman_co Posted July 16, 2004 Posted July 16, 2004 I just got this and I need a way to loop through all the RTF files in a directory, open them in WordPad, save them and then exit. I have found looping and I got the script to work with one specific file. Have been banging my head searching for a way to process all the files in a directory. Any help will be greatly appreciated.
Developers Jos Posted July 16, 2004 Developers Posted July 16, 2004 Hope this helps ; Shows the filenames of all files in the current directory, note that "." and ".." are returned.$search = FileFindFirstFile("*.*") ; Check if the search was successfulIf $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") ExitEndIfWhile 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file)WEnd; Close the search handleFileClose($search) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Toppy Posted July 20, 2004 Posted July 20, 2004 (edited) I was gonna fix this for the "." and ".." not to show, but since goto is now called "evil" how can I do this ? While 1 :Tester $file = FileFindNextFile($search) If $file = "." Then goto Tester If $file = ".." Then goto Tester Edited July 20, 2004 by Toppy
magicboy Posted July 20, 2004 Posted July 20, 2004 @ Toppy Why not something like ... While 1 $file = FileFindNextFile($search) If $file <> "." AND $file <> ".." Then ; <> = Not Equal If @error Then ExitLoop MsgBox(4096, "File:", $file) EndIf WEnd Have not tested this but should put you in the right direction.
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