Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Open file, Save and Close - different for non standard programs?

$
0
0
I am trying to automate the process of opening a file in a program, saving it (this process updates parameters in the file for me) and closing the program.

First I tried FileOpen but it does not seem to open the file and does not close the program either:

[ autoit ]      
run("FullProgramPath\MyProgram.exe") WinWaitActive("MyProgram - Untitled") Local $file = FileOpen("test.abc") If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf MsgBox(0, "Got here", "Made it here") FileClose($file)

I tried giving the full path of "test.abc", putting it in the same directory as the autoit script and using the various optional mode. The only way I seem to be able to open the file in my program is using ShellExecute("FullPath\test.abc") but then I run into the problem of not knowing how to "save" and "close".

I am aware that I didn't address the "saving" issue in my autoit code but I couldn't get that far since I wasn't able to open anything...

Any suggestions would be greatly appreciated. Thanks!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>