The Get Selected Tree Item action is used to populate a variable or dataset with the contents a selected item in a tree view. This action is ordinarily preceded by a Select Tree Item action. Any variable used must be created in an earlier step using the Create Variable action.
If you populate a dataset with the tree item, the fields will show the text, level, and index for both the item and its parent, plus whether or not the tree view is expanded.
Important: Only standard Windows controls will work with the Get Selected Tree Item action. Many applications use images or other controls that may act like Windows controls but do not support the interfaces required to detect them. The Get Selected Tree Item action will not work with these controls. In these cases other interactivity actions must be used such as the Copy action.
From the Task Builder Available Actions pane, open the Interactivity folder and double-click the Get Selected Tree Item action or drag it into the Steps pane.
To populate a variable with the text of the item, select the variable in the Populate variable with text box.
If possible, open the window containing the tree you want to use. Then drag the AutoMate icon to the tree view. This will automatically populate the object description. If you cannot use the actual window containing the tree view, use a similar one and then edit the object description per the next step. You can also drag the AutoMate icon to the window that contains the object, and then click the Browse button to find and select the object.
If you need to make changes to the auto-populated properties, click Edit and change the properties according to the following guidelines:
Select or clear the check boxes to indicate which properties are required.
Edit any required properties as desired. You can use wildcard characters asterisk (*) or question mark (?) in titles, classes, names, or values. For example *report* can be used to specify any name containing the word report.
To use a variable or expression, click within any box and then click the Insert Expression/Variable button and use the Expression Builder to enter it.
The properties are as follows:
Window title must be: the window title as shown in the title bar. The entry is case sensitive.
Window class must be: the class of window. The drop-down list shows the classes of all currently open windows. The entry is case sensitive.
Window handle must be: a unique value that Windows assigns each time a window is created. You might use this for situations where there may be more than one copy of the same application open.
Object type must be: the type of object, which for this action will always be TreeStructure.
Object class must be: the Windows class of the object.
Object name must be: the name of the object. This is usually inapplicable for this action.
Object value must be: the value of the object. This is usually inapplicable for this action.
Object position must be: the coordinates for the position of the object on the screen.
Click the Advanced tab.
To populate a variable with the tree level of the selected item, select Populate variable with indentation level and then select the variable in the box below.
populate a dataset with the item and its tree structure data, select Create and populate dataset and then
enter a name for the dataset in the box below. (Dataset
names must be alphanumeric, begin with a letter, and contain no spaces.)
The dataset fields will show the index, level, and text of the current node, as well as the parent index and text. Additionally, an IsExpanded field shows whether or not the node has children and is expanded.
To set the Description tab properties, refer to Description Tab Options.
To set the Error Causes and On Error tab properties, refer to Step Error Handling.
When finished, click OK to save settings and close the properties dialog window.
Adding Task Steps
Get Selected Tree Item Action