Launch and Attach Window
Verb: launchWindow
Launches a window of a Windows application and attaches it with the current execution context.
Syntax
launchWindow --executablepath(String) [--parameters(String)] [--safesearch(Boolean)] [--timeout(TimeSpan)] (Window)=value (Numeric)=processId (Boolean)=success
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--executablepath | Executable | Required | Text | Path to the application that should be launched. |
--parameters | Parameters | Optional | Text | Command line parameters used when launching the Executable. |
--safesearch | Safe search | Optional | Boolean | When enabled, a higher performance search algorithm is executed. |
--timeout | Timeout | Optional | Time Span, Number, Text | Command execution timeout.
In case no value is defined for the timeout parameter, the execution uses the context timeout defined by the Set Timeout command. If that command is not used on the script, the default timeout is 5 seconds. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Window | Window | Returns the launched window. |
processId | Process id | Number | Returns the process id of the launched window. |
success | Success | Boolean | Returns True to report process success, or False if otherwise. |
Example
Launches a Notepad window and attaches it to the current execution context, returning variables with the opened window, the process id and the success of the execution.
defVar --name success --type Boolean
defVar --name startedWindow --type Window
defVar --name processId --type Numeric
launchWindow --executablepath "C:\\Windows\\notepad.exe" --timeout 00:00:20 processId=processId success=success startedWindow=value
logMessage --message "\r\n${success}\r\n${processId}" --type "Info"
// Opens a Notepad window and associates it with context.
Remarks
The window opened by Launch and Attach Window is automatically attached to the current execution context. Thus, if manipulation of another window is required immediately after executing this command, it must be attached to the context first.
The Executable parameter must contain the correct and complete path to the application executable.