Focus Window
Verb: focusWindow
Focuses on a window, bringing it to the foreground.
Syntax
focusWindow --window(Window)
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--window | Window | Required | Window | Window that should be focused on. |
Example
The Launch and Attach Window command opens a Notepad window. Next, the Type Text command types the text "First open window" into the file. The process is repeated, but this time the Type Text command types the text "Second open window". Finally, the Focus Window command focuses on the window opened first.
defVar --name notepadWindow1 --type Window
defVar --name notepadWindow2 --type Window
launchWindow --executablepath "C:\\Windows\\notepad.exe" notepadWindow1=value
typeText --text "First open window!"
launchWindow --executablepath "C:\\Windows\\notepad.exe" notepadWindow2=value
typeText --text "Second open window!"
delay --timeout 00:00:02
focusWindow --window ${notepadWindow1}
delay --timeout 00:00:02
// Opens two Notepad windows, typing a text in each and focuses on the first.
Remarks
Attention: If the window defined as a value in the Window parameter is not open, execution continues normally, the command just has no effect.