Process Start and Identification
The StartProcess
and WaitProcess
commands ensure that the script interacts with the correct windows app before running the main body of the script.
The LaunchUrl
command allows integration with web applications.
This command is used when a web app requires a desktop script because the web app technology is not compatible with a browser extension, e.g. Flash, Java or IE compatibility mode apps.
browserTarget - URL (or URI) of website / file to open in the default browser
LaunchUrl "https://SomeSite.com/login"
Or, if the URL is in the Path to App field
LaunchUrl bmPathToApp
Used to start a desktop application if the user clicks on an app’s Vault tile.
If the application is started from the user’s desktop (i.e. not by clicking on a vault tile) and the Allow OS Launch setting on the application template is disabled then a runtime error is raised.
If OS launch is permitted then StartProcess
does nothing when an app is started from the desktop.
Refer to the syntax diagrams for the valid combinations and positioning of the parameters.
Parameter Name | Description |
---|---|
executableName | The path to the executable or file to be launched. This is the only mandatory parameter. |
commandArgument | Command line arguments for process start. |
startIn | Path to the startup folder for the app. This is not normally required. If needed then the commandArgument must be provided, use an empty string if no actual arguments are needed. |
SingleInstance | Informs the system that the application only allows one instance to run. i.e. regardless of how often the app is started only one process instance actually runs. |
Morphs morphedExecutableName | If the process morphs into a different process (and it does not have the same name as the original) then this is the process name or filename of the new process. |
timeoutMilliseconds | In milliseconds. Amount of time to wait for the process to start before throwing an error. The default is 4,000 (4 seconds) |
Starts the application defined by the desktop application template, passing in the command line arguments.
StartProcess bmAppPath bmAppArgument
See the Advanced Script Examples for more examples.
The WaitProcess
command pauses the execution of the script until a matching process is identified, or the timeout expires.
The default timeout is 10 seconds.
Refer to the syntax diagrams for the valid combinations and positioning of the parameters.
Parameter Name | Description |
---|---|
Secondary | Does not change the process that the script is attached to. |
processMatchOptions | |
timeoutMilliseconds | Length of time to wait until process is found before raising an error. |
The simplest mode of use is to have the command wait for a process that matches a specific file path or process name. E.g. both of the following will wait until a new instance of Notepad is detected:
WaitProcess "C:\WINDOWS\system32\notepad.exe"
WaitProcess "Notepad"
If the process to be waited on is the one specified in the “Path to App” template field then you can use the template variable:
WaitProcess bmAppPath
The Caption
option allows you to specify the target process by matching text in its main window caption. The command below will wait until a window is visible whose caption begins with the text “My App”
WaitProcess Caption BeginsWith "My App"
Details on caption matching are shown below.
WaitProcess
may be required more than once in a script when the script needs to pause until a secondary process is running. This is the case when the windows credential dialog is used.
E.g. for the remote desktop app, the user is prompted for their credentials in what looks like a normal window, but it’s actually a separate process.
// Wait for credential dialog to open by its process exe name
WaitProcess Secondary "CredentialUIBroker.exe"
The Secondary
option prevents the script from replacing the process it started with by this secondary process. If this option is not used then subsequent commands will not work against the main application. The default behaviour is to run the script in the context of the process that has been found.
If the user has the My1Login browser extension installed then they can launch desktop applications by clicking on the application’s vault tile. (If the template allows it.)
In certain cases it may be necessary to perform additional scripting, such as opening a login window, that isn’t necessary if the app is started from a desktop shortcut.
WhenVaultLaunch
wraps a set of script commands between start and end braces { }
. These commands are only executed if the script is started as a result of the user clicking on a vault tile.
None.
The SAP GUI application requires the login window to be opened if it is launched from the vault, but not if it is launched from the user’s desktop. See also the full example for SAP GUI Application.
// Force SAP GUI app into a specific mode on vault
// startup by clicking a specific toolbar button
WhenVaultLaunch
{
// Force the Explorer View
// (select then click the button)
SelectControl ControlButton 0x801B
LeftClick HorizontalMiddle VerticalMiddle
}