Clark 2 Posted May 3, 2011 Hi all The following code is meant to open a file for reading, and open (or create) a file for writing. #include <File.au3> $message = "Please select a file to convert" $initialDir = "W:\Testing\Tools\Diehard" $var = FileOpenDialog($message, $initialDir & "\", "All (*.*)", 1 ) If @error Then MsgBox(4096,"","No File(s) chosen") exit Else $var = StringReplace($var, "|", @CRLF) MsgBox(4096,"","You chose " & $var) EndIf $message="Please select a file to write to" $var = FileOpenDialog($message, $initialDir & "\", "All (*.*)", 1 + 8 ) If @error Then MsgBox(4096,"","No File(s) chosen") exit Else $var = StringReplace($var, "|", @CRLF) MsgBox(4096,"","You chose " & $var) EndIf What seems to happen is the final dialog lets me enter a file name to create, the msgbox says I have selected the file I want to create, but looking in the directory there is no file there. What am I missing here? TIA Share this post Link to post Share on other sites
wakillon 403 Posted May 3, 2011 Try to use FileSaveDialog instead FileOpenDialog in the second part ! #Include <File.au3> Global $_FileSaveDialog, $_FileOpen, $_FilePath = @DesktopDir & '\TextFile.txt' _FileCreate ( $_FilePath ) $_FileSaveDialog = FileSaveDialog ( "Select File", @DesktopDir, "Text (*.txt)", 2 + 16 ) ConsoleWrite ( "$_FileSaveDialog : " & $_FileSaveDialog & @Crlf ) FileCopy ( $_FilePath, $_FileSaveDialog ) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites