Scottswan Posted May 11, 2005 Share Posted May 11, 2005 I'm writing a script to open one file type with a running application and then have that application save the file in a new file format. It's using standard windows explorer file - open dialog, it's a VB app. What would be the best way to have the script select the next file to open in the current directory? I could use an elaborate combination of sendkey's with tabs and arrow keys, but there will be hardly any error checking with that and it might go haywire. Or maybe make a GUI and ask for the folder that contains all the files to be converted, then somehow store all the filenames as variables, increment through them and have it actually type (send) the filename to the file-open dialog. Except I don't know how to do that. Any clever ideas? This is the only part I'm stuck on. -Scott Link to comment Share on other sites More sharing options...
MHz Posted May 11, 2005 Share Posted May 11, 2005 What about this ? ; Shows the filenames of all files in the current directory, note that "." and ".." are returned. $search = FileFindFirstFile("*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($search) Link to comment Share on other sites More sharing options...
Scottswan Posted May 11, 2005 Author Share Posted May 11, 2005 What about this ?Yea, that might work, thanks! I didn't even think to look at that one as I already know where my files are.The current directory is the directory that the script is running in right?-Scott Link to comment Share on other sites More sharing options...
MHz Posted May 11, 2005 Share Posted May 11, 2005 @ScriptDir is where you are running your script. You can use FileChangeDir() to set your working directory. Link to comment Share on other sites More sharing options...
Scottswan Posted May 11, 2005 Author Share Posted May 11, 2005 @ScriptDir is where you are running your script. You can use FileChangeDir() to set your working directory.<{POST_SNAPBACK}>Is there a way to give the option to browse for the directory if I prompt for the directory location? Link to comment Share on other sites More sharing options...
CyberSlug Posted May 11, 2005 Share Posted May 11, 2005 Is there a way to give the option to browse for the directory if I prompt for the directory location?<{POST_SNAPBACK}>FileOpenDialog ? 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...
Scottswan Posted May 11, 2005 Author Share Posted May 11, 2005 FileOpenDialog ?<{POST_SNAPBACK}>Close, but FileSelectFolder is perfect!Man, I'm just not finding things well today. 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