darcaro Posted May 31, 2007 Share Posted May 31, 2007 I would like to use the FileOpenDialog function to pass a variable to and/or from an external program (or DOS batch file). Is there any way to assign a variable to the path, say $PATH is = "c:\windows" , then use that variable in the function and when I select the file, send back the filename in a variable? Any help would be greatly appreciated. thanks!! Link to comment Share on other sites More sharing options...
Zedna Posted May 31, 2007 Share Posted May 31, 2007 Example from HelpFile - see FileOpenDialog$message = "Hold down Ctrl or Shift to choose multiple files." $var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.bmp)", 1 + 4 ) If @error Then MsgBox(4096,"","No File(s) chosen") Else $var = StringReplace($var, "|", @CRLF) MsgBox(4096,"","You chose " & $var) EndIf Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
evilertoaster Posted May 31, 2007 Share Posted May 31, 2007 You do know that fileopendialog retrns the filename of the file you selected? Link to comment Share on other sites More sharing options...
darcaro Posted May 31, 2007 Author Share Posted May 31, 2007 thanks for your replies - I guess what I want to do is be able to assign the filename to a variable (which the function already does) , but use it in another program , like a DOS batch file or some other external program. Is that possible? Link to comment Share on other sites More sharing options...
evilertoaster Posted May 31, 2007 Share Posted May 31, 2007 There are several ways to make your data avialable to another program. Bascialyl you have to write it to somewhere it can read, this could be - 1. A File 2. A registry Key 3. a stdin stream 4. A network socket 5. windows clipboard 6. some other location in memory (carefull...) Link to comment Share on other sites More sharing options...
darcaro Posted June 1, 2007 Author Share Posted June 1, 2007 Thank you for the great replys - I guess the best option would be to store the data in a temporary text file. Is there an easy way to just write the filename to a text file?? I could then use it from there for what I want to do. I would also like to define the path name externally (ie, have the fileopendialog run, but use a variable for the path name, file type, etc ) Is there a way to specify a variable in the "command line", and have the function use it? 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