Is Selected
Checks whether a UI element is currently selected.
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 element.
- Window Selector - The selector for identifying the target window.
- Element Selector - The selector for identifying the target element.
Output
- Selected - Boolean value indicating whether the element is selected (true) or not selected (false).
How It Works
The Is Selected node checks whether a UI element is currently selected. When executed, the node:
- Uses the Window Selector and Element Selector to locate the target element
- Retrieves the SelectionItemPattern of the element
- Checks the IsSelected property of the pattern
- Sets the output variable "Selected" to true if the element is selected, false otherwise
Requirements
- The target element must support the SelectionItemPattern 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
- SelectionItemPattern not supported by the element
Usage Notes
- This node is useful for checking the state of selectable elements like list items, tree items, or radio buttons
- The output value can be used in conditional logic or stored for later use
- For elements that can be part of a selection group, this indicates if the specific element is selected
- This is different from "enabled" state - an element can be enabled but not selected