Encapsulates the AutoMate™ action in the “General” group, “Start an application.” The method attempts to start the given application using the specified commandline.
Declaration
function StartApplication (varCommandLine As Variant,
varParameters As Variant,
varDefaultDir As Variant,
intWindowState As Integer,
intWaitUntilReady As Integer,
intWaitUntilDone As Integer) As Integer
Parameters
varCommandLine
The commandline AutoMate™ should use to start the application (e.g. C:\Program Files\Unisyn\AutoMate4\Settings.exe). Note that the commandline is not case sensitive.
varParameters
Any additional parameters that may be needed to run the program.
varDefaultDir
Path to the directory where AutoMate™ should start the program.
intWindowState
An integer specifying how AutoMate™ should attempt to display the window:
Value |
Meaning |
0 |
Normal |
1 |
Maximized |
2 |
Minimized |
3 |
Hidden |
intWaitUntilReady
Specifies whether or not AutoMate™ should wait until the application is finished its startup procedures and signals it is ready to accept input before continuing. Set to “1” to have AutoMate™ wait or “0” otherwise.
intWaitUntilDone
Specifies whether or not AutoMate™ should wait until the started application closes before returning. Set to “1” to make the method wait until the application has completed before returning or “0” otherwise.
Description
The StartApplication method attempts to start a standard Windows or DOS-based program at the path specified by varCommandLine. AutoMate™ can be told to wait until the application is ready for input or wait until the application is done, before continuing with the next line in the script. Setting both intWaitUntilReady and intWaitUntilDone to “1” is undefined.
If the program pointed to by varCommandLine cannot be started for whatever reason, the method will return “1.” Use the GetLastError property for more information about why the method failed.