ntprohd Posted March 31, 2016 Share Posted March 31, 2016 (edited) I have a function func to run the command line in the .txt file, when I run it on file .au3 it done, but when I compile it into an .exe file, it does not work func. Compiled script (play.exe) Func _Play($sFilePath, $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0) Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"', $sWorkingDir, $iShowFlag, $iOptFlag) EndFunc While 1 _Play("play.txt") Exit WEnd Called script (play.txt) run("Notepad.exe") Sleep(1000) ControlSend("Untitled - Notepad","","[CLASS:Edit; INSTANCE:1]","hello 1" & @CR) Sleep(1000) ControlSend("Untitled - Notepad","","[CLASS:Edit; INSTANCE:1]","hello 2" & @CR) Sleep(1000) ControlSend("Untitled - Notepad","","[CLASS:Edit; INSTANCE:1]","hello 3" & @CR) Edited March 31, 2016 by ntprohd Link to comment Share on other sites More sharing options...
Developers Jos Posted March 31, 2016 Developers Share Posted March 31, 2016 Add this line at the top of your script: #pragma compile(AutoItExecuteAllowed, true) Jos ntprohd 1 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. Link to comment Share on other sites More sharing options...
ntprohd Posted March 31, 2016 Author Share Posted March 31, 2016 14 minutes ago, Jos said: Add this line at the top of your script: #pragma compile(AutoItExecuteAllowed, true) Jos thank you, working well right now GuyFromNJo 1 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