Run(Wait) command cannot parse non-exe parameters
Posted: 04 Feb 2014, 14:19
I'm working on an .ahk script that needs to launch another .ahk script with one or more parameters. For testing, I've made a tiny target script, Testfile.ahk, and also compiled that script as Testfile.exe.
When I try to pass a simple parameter to Testfile, it works for Testfile.exe but not for Testfile.ahk. Here is a test script:
The first three commands execute with no problem, and the third one passes the correct parameter, but the last command gives the following error message:
When I try to pass a simple parameter to Testfile, it works for Testfile.exe but not for Testfile.ahk. Here is a test script:
Code: Select all
RunWait Testfile.exe
RunWait Testfile.ahk
RunWait Testfile.exe testing
RunWait Testfile.ahk testing
Apparently, the command parser recognizes that what follows ".exe" is a parameter, but it does not recognize that for what follows ".ahk". Instead, it concatenates the parameter into the action, resulting in an invalid action.Error: Failed attempt to launch program or document:
Action: <Testfile.ahk testing>
Params: <>
The current thread will exit.
Specifically: The system cannot find the file specified.
Line#
001: RunWait,Testfile.exe
002: RunWait,Testfile.ahk
003: RunWait,Testfile.exe testing
---> 004: RunWait,Testfile.ahk testing
004: Exit