Set Selected
Selects or deselects a UI element that supports selection.
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.
Options
- Selected - Whether to select or deselect the element. Default is true (select).
How It Works
The Set Selected node selects or deselects a UI element that supports selection. When executed, the node:
- Uses the Window Selector and Element Selector to locate the target element
- Retrieves the SelectionItemPattern of the element
- Based on the Selected option:
- If true: Calls Select() method to select the element
- If false: Calls RemoveFromSelection() method to deselect the element
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 working with list items, tree items, or other selectable elements
- For elements in a single-selection container, selecting one element will deselect others
- For elements in a multi-selection container, multiple elements can be selected
- The element must be visible and enabled to be selected or deselected
- This is different from setting focus - an element can be selected without having focus