Skip to main content

Get Text

Retrieves the text content from a text element.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Handle - The handle of the window containing the text element.
  • Window Selector - The selector for identifying the target window.
  • Element Selector - The selector for identifying the text element.

Output

  • Text - The text content retrieved from the element.

How It Works

The Get Text node retrieves the text content from a text element. When executed, the node:

  1. Uses the Window Selector and Element Selector to locate the target text element
  2. Attempts to retrieve the text using multiple TextPattern implementations:
    • TextPattern
    • TextPattern2
    • TextEditPattern
    • TextControl().GetTextPattern() (fallback)
  3. Extracts the text content from the document range
  4. Sets the output variable "Text" to the retrieved content

Requirements

  • The target element must support at least one text pattern interface
  • Both Window Selector and Element Selector are required to identify the target element

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Window Selector or Element Selector
  • Element not found
  • No supported TextPattern found on the element

Usage Notes

  • This node works with various text elements including text boxes, labels, and rich text controls
  • The node tries multiple text pattern implementations to maximize compatibility
  • The output text preserves formatting as plain text
  • For rich text elements, only the plain text content is returned