Get Selected Tree Item Action Icon

Get Selected Tree Item

 

Declaration

<AMGETSELECTEDTREEITEM WINDOWTITLE="text" OBJECTCLASS="text" OBJECTTYPE="text" CHECKOBJECTCLASS="Yes/No" CHECKOBJECTTYPE="Yes/No" CHECKOBJECTPOSITION="Yes/No" OBJECTXPOS="Number" OBJECTYPOS="Number" RESULTVARIABLE="text" RESULTDATASET="text" />

See Also

Check | Click Mouse | Get Selected List Item | Get Text | Hold Down Key | Move Mouse | Move Mouse to Object | Press | Release Key | Select Item | Select List Item | Select Tree Item | Send Keystrokes | Set Text

Description

Retrieves the currently selected item or items of a tree control. The control can be selected from an existing window either by using the Browse button or by dragging the AutoMate icon to the area on the screen.

IMPORTANT: Only standard Windows tree controls will work with this action. Many applications use images or other controls that may act like tree controls but they are not native Windows controls; the Get Selected Tree Item action will not work with these controls.

Practical Usage

Mainly used to retrieve the text contents or indent level of the currently selected item(s) on a tree control.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Populate variable with text

Text

Yes

(Empty)

RESULTVARIABLE="theVar"

The name of an already existing variable that should be populated with the caption text of the node.

After selecting the target control by dragging the AutoMate icon to the desired object, the "Object Description" section will be populated with the characteristics of the control. Click the Edit button to access/edit the following properties:

Window Title must be

Text

Yes

(Empty)

  1. WINDOWTITLE="Desktop"

  2. WINDOWTITLE="*"

If enabled, specifies the title of the Window that the control search should be restricted to. This value is case-insensitive. A Window title is required because without this parameter the action would have to search every control of every single Window on the system which would take an unacceptable amount of time. This parameter supports wildcards (* and ?), for example "*Internet Explorer* would include all Windows containing that text.

NOTE: If this parameter is left blank, the action assumes it is searching for a Window title that is blank - to ignore the Window title, use *.

Window Class must be

Text

No

(Empty)

WINDOWCLASS="Outlook Express Browser Class"

If enabled, specifies the class of the Window to act on. This value is case-insensitive. This parameter supports wildcards (* and ?), for example "*Internet Explorer* would include all window classes containing that text.

NOTE: If this parameter is left blank, the action assumes it is searching for a Window class that is blank - to ignore the WIndow class, use *.

Window Handle must be

Number

No

(Empty)

WINDOWHANDLE="555735"

If enabled, specifies the handle of the Window to act on. If set to 0 or omitted, this parameter is ignored.

Object type must be

Yes/No

Yes

Yes

CHECKOBJECTTYPE="YES"

If set to YES, specifies that the type parameter will be checked against the control when determining a matching control. If set to NO the type of the control is ignored.

Object type (Text-box)

Text

Yes

(Empty)

OBJECTTYPE="PushButton"

Specifies the type of control that should be checked. This parameter is ignored if the Object type must be parameter is set to NO.

Object class must be

Yes/No

No

No

CHECKOBJECTCLASS="YES"

If set to YES, specifies that the class parameter will be checked against the control when determining a matching control. If set to NO the class of the control is ignored.

Object class (text-box)

Text

No

(Empty)

OBJECTCLASS="SysTreeView32"

Specifies the class of the control that should be checked. This parameter is ignored if the Object class must be parameter is set to NO.

Object name must be

Yes/No

No

No

CHECKOBJECTNAME="YES"

If set to YES, specifies that the name parameter will be checked against the control when determining a matching control. If set to NO, the name of the control is ignored.

Object name (text-box)

Text

No

(Empty)

OBJECTNAME="Cancel"

Specifies the name of control that should be checked. This parameter is ignored if the Object name must be parameter is set to NO.

Object value must be

Yes/No

No

No

CHECKOBJECTNAME="YES"

If set to YES, specifies that the value parameter will be checked against the control when determining a matching control. If set to NO, the value of the control is ignored.

Object value (text-box)

Text

No

(Empty)

OBJECTVALUE="1"

Specifies the value of control that should be checked. This parameter is ignored if the Object value must be parameter is set to NO.

Object position must be

Yes/No

No

No

CHECKOBJECTPOSITION="YES"

If set to YES, specifies that the X and Y coordinates will be checked against the position of the control when determining a matching control. If set to NO, the position of the control is ignored.

NOTE: The X and Y coordinates specified are relative to the Window specified in the Window Title Parameter (not the screen).

Position X

Text

No

(Empty)

OBJECTXPOS="80"

Specifies the X coordinate position of the control relative to the Window specified in the Window title must be parameter. To specify variable coordinates, use wildcard characters (i.e. * or ?). This parameter is ignored if the Object position must be parameter is set to NO.

Position Y

Text

No

(Empty)

OBJECTYPOS="90"

Specifies the Y coordinate position of the control relative to the Window specified in the Window title must be parameter. To specify variable coordinates, use wildcard characters (i.e. * or ?). This parameter is ignored if the Object position must be parameter is set to NO.

Advanced Properties

Property

Req'd

Required

Default

Markup

Description

Populate Variable With Indentation Level

Text

No

(Empty)

ITEMLEVELVARIABLE="myvar"

The name of an already existing variable that should be populated with the level of indentation for the selected item.

Create and Populate Dataset

Text

No

(Empty)

RESULTDATASET="DatasetName"

The name of a dataset to be created and populated with data from the selected tree item(s). More on the fields that this dataset creates can be found below under Notes.

Description Properties

The Description tab allows you to customize the text description of any step when it appears in the Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab is part of AutoMate's Error Handling functionality which allows you to select / omit specific errors that will cause a particular step to fail.

More about error causes properties

On Error Properties

The On Error tab is part of AutoMate's Error Handling functionality which allows you to determine what the task should do if a particular step encounters an error.

More about on error properties

Notes

Datasets

A dataset is a multiple column, multiple row container object. This action creates and populates a dataset with the following fields (rows):

Name

Type

Return Value

theDataset.Level

Number

Returns the level of the node

theDataset.Text

Text

Returns the caption text of the node

theDataset.Index

Number

Returns the index of the node (zero-based)

theDataset.ParentText

Text

Returns the caption text of the node's parent (returns nothing if there is no parent).

theDataset.ParentIndex

Number

Returns the the index of the node's parent.

theDataset.IsExpanded

Yes/No

Returns YES if the node has children and is in an expanded state. Returns NO if in a non-expanded state.

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions
More on the expression builder

Window Dissection™ Technology

This action contains a subset of Network Automation's unique "Window Dissection Technology".

Click here for more information

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: Get item selected in tree: (class = "SysTreeView32", name = "", type = "TreeStructure", value = "", X = "2", Y = "153", check class = "YES", check name = "NO", check type = "YES", check value = "NO", check position = "YES") and populate variable "theVar" with text item.  The object must be in the window "RoboHelp HTML - AM8_Help - [Get Selected Tree Item Action *]".  Create and populate dataset "theDataset" with details of the node.  

 

<AMGETSELECTEDTREEITEM WINDOWTITLE="RoboHelp HTML - AM8_Help - [Get Selected Tree Item Action *]" OBJECTCLASS="SysTreeView32" OBJECTTYPE="TreeStructure" CHECKOBJECTCLASS="YES" CHECKOBJECTTYPE="YES" CHECKOBJECTPOSITION="YES" OBJECTXPOS="2" OBJECTYPOS="153" RESULTVARIABLE="theVar" RESULTDATASET="theDataset" />

 

↑ Top of Page