Find Windows
Verb: findWindows
Finds open windows that match the defined criteria.
Syntax
findWindows [--useregex(Boolean)] [--title(String)] --regexPattern(String) [--regexOptions(DisplayableRegexOptions)] [--id(String)] [--classname(String)] [--processid(Numeric)] [--processname(String)] [--byparent(Boolean)] [--window(Window)] [--recursive(Boolean)] [--safesearch(Boolean)] [--styles(Nullable<AutomationWindowStyles>)] [--minimumheight(Numeric)] [--minimumwidth(Numeric)] (List<Window>)=value
Inputs
| Script | Designer | Required | AcceptedTypes | Description |
|---|---|---|---|---|
| --useregex | Use Regular Expression | Optional | Boolean | When enabled, regular expression is used to find the windows. |
| --title | Title | Optional | Text | Title of the windows that should be found. |
| --regexPattern | Regular Expression | Only whenUse Regular Expression is True | Text | Regular expression used to identify the windows that should be found. |
| --regexOptions | Options | Optional | DisplayableRegexOptions | Options for regular expression matching:
|
| --titleAsRegex | Title is regular expression(Obsolete) | Optional | Boolean | When enabled, allows the use of a "Regular Expression" to search for the window title.
This parameter is obsolete, the Use Regular Expression parameter should be used instead. |
| --ignorecase | Ignore case(Obsolete) | Optional | Boolean | When enabled, specifies case-insensitive matching.
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --dotmatchesnewline | Dot matches new line(Obsolete) | Optional | Boolean | When enabled, the dot (.) character matches every character, instead of every character except "\n".
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --freespacing | Ignore white space(Obsolete) | Optional | Boolean | When enabled, eliminates blank spaces and breaks without adding a escape character.
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --explicitcapture | Explicit capture(Obsolete) | Optional | Boolean | When enabled, specifies that the only valid captures are explicitly named or numbered groups of the form (?
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --multiline | Multiline(Obsolete) | Optional | Boolean | When enabled, changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.
This parameter is obsolete. To select regular expression options, use the Options instead. |
| --id | Identifier | Optional | Text | Id of the windows that should be found. |
| --classname | Class Name | Optional | Text | Class name of the windows that should be found.
Use the recorder to obtain this information. |
| --processid | Process Id | Optional | Number | Id of the process to which the windows belong. |
| --processname | Process Name | Optional | Text | Name of the process to which the windows belong. |
| --byparent | Search in Attached Windows | Optional | Boolean | When enabled, allows searching for child windows. |
| --window | Window | Optional | Window | Main window of which the child windows should be found. |
| --recursive | Recursive | Optional | Boolean | When enabled, allows finding windows within windows. |
| --safesearch | Safe Search | Optional | Boolean | When enabled, a better performance window search algorithm is executed. |
| --styles | Styles | Optional | AutomationWindowStyles | Styles of the windows that should be found. |
| --minimumheight | Minimum Height | Optional | Number | Minimum height of the windows that should be found. |
| --minimumwidth | Minimum Width | Optional | Number | Minimum width of the windows that should be found. |
Outputs
| Script | Designer | AcceptedTypes | Description |
|---|---|---|---|
| value | Windows | List<Window> | Returns a list of the windows found. |
Example
The Find Windows command finds the Notepad windows, and the Count Items command informs the number of windows found.
defVar --name foundedWindows --type List --innertype Window
defVar --name windowsQuantity --type Numeric
launchWindow --executablepath "notepad.exe"
launchWindow --executablepath "notepad.exe"
findWindows --classname Notepad foundedWindows=value
// Find open Notepad windows and store them in a list.
count --collection "${foundedWindows}" windowsQuantity=value
// Counts the number of windows found and displays the result in the console.
logMessage --message "Windows Quantity: ${windowsQuantity}" --type "Info"