Find Window

Verb: findWindow

Finds an open window that matches the defined criteria.

Syntax

findWindow [--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)] (Window)=value (Numeric)=processId (Boolean)=success

Inputs

Script Designer Required AcceptedTypes Description
--useregex Use Regular Expression Optional Boolean When enabled, allows using a regular expression to find the window.
--title Title Optional Text Title of the window that should be found.
--regexPattern Regular Expression Only whenUse Regular Expression is True Text Regular expression used to identify the window that should be found.
--regexOptions Options Optional DisplayableRegexOptions Options for regular expression matching:
  • Compiled
  • Culture Invariant
  • ECMA Script
  • Explicit Capture
  • Ignore Case
  • Ignore Pattern Whitespace
  • Multiline
  • Right To Left
  • Singleline
  • --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 window that should be found.
    --classname Class Name Optional Text Class name of the window that should be found.
    --processid Process Id Optional Number Id of the process to which the window belongs.
    --processname Process Name Optional Text Name of the process to which the window belongs.
    --byparent Search in attached window Optional Boolean When enabled, it allows searching for child windows of a window attached to the context.
    --window Window Optional Window Main window of which a child window should be found.
    --recursive Recursive Optional Boolean When enabled, allows finding windows within windows.
    --safesearch Safe Search Optional Boolean When enabled, a higher performance search algorithm is performed.
    --styles Styles Optional AutomationWindowStyles Styles of the window that should be found:
  • Child
  • Dialog
  • --minimumheight Minimum Height Optional Number Minimum height of the window to be found.
    --minimumwidth Minimum Width Optional Number Minimum width of the window that should be found.

    Outputs

    Script Designer AcceptedTypes Description
    value Window Window Returns the found window.
    processId Process Id Number Returns the process Id.
    success Success Boolean Returns "True" if the window was found successfully, or "False" if it was unsuccessful.

    Example

    The command tries to find a Notepad window, opened by Launch and Attach Window.

    defVar --name foundWindow --type Boolean
    defVar --name Id --type Numeric
    launchWindow --executablepath "notepad.exe" Id=processId
    findWindow --processid ${Id} foundWindow=success
    logMessage --message "Result found the window: ${foundWindow}" --type "Info"
    // Displays on the IBM Robotic Process Automation Studio console whether or not the window was found.
    

    Remarks

    It is possible to use the IBM Robotic Process Automation Studio recorder to obtain the following information:

  • "Class Name", used in Class Name;
  • See Also

  • Attach Window
  • Cancel Token Source
  • Clear Cache
  • Click
  • Click on Cell
  • Click on Menu
  • Click on Value
  • Close Window
  • Control Screenshot
  • Count Windows
  • Expand Tree
  • Find Windows
  • Focus
  • Focus Window
  • Get Barcode
  • Get Bounds
  • Get Cell Value
  • Get Control
  • Get Image Grid
  • Get Interval
  • Get Options
  • Get Table
  • Get Table Information
  • Get Tree Nodes
  • Get Value
  • Handle Open File Dialog
  • Handle Save File Dialog
  • Launch and Attach Window
  • Launch or Attach Window
  • Map Image Grid
  • Maximize or Minimize Window
  • Offset Value
  • Screenshot Window
  • Select Row
  • Select Tab
  • Set Execution Throttling
  • Set Grid Value
  • Set Value
  • Show or Hide Element
  • Update Window
  • Verify Enabled
  • Verify If Visible
  • Wait and Close Security Window
  • Wait Busy Window
  • Wait Control
  • Wait for Control to Enable
  • Wait for Window to Appear
  • Watch and Close Window