Select List Item Action Icon

Select List Item

 

Declaration

<AMSELECTLISTITEM WINDOWTITLE="text" OBJECTCLASS="text" OBJECTTYPE="text" CHECKOBJECTCLASS="yes/no" CHECKOBJECTTYPE="yes/no" CHECKOBJECTPOSITION="yes/no" OBJECTXPOS="text" OBJECTYPOS="text" ITEMTEXT="text">

See Also

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

Description

Selects one or more items in a list box or a list view. To select an object from an existing window, either use the Browse... button or drag the AutoMate icon to the desired item 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; this action will not work with these controls.

Practical Usage

Used to retrieve the text or index of the currently selected item(s) in a list control.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Action

Text (Options)

Yes

Select first item with text

ACTION="all_selection"

Specifies how selected items should be retrieved. The available options are:

  • Select first item with text (default): If multiple items are selected, return only the first item with text.

  • Select last item with text: If multiple items are selected, return only the last item with text.

  • Get all items selected: If multiple items are selected return all the items with text in a comma-delimited list.

  • Select all items: If multiple items are selected return all the items with or without text in a comma-delimited list.

  • Select items at index: If multiple items are selected return all the items starting at the specified index.

Text (or index) of item to select

Text or Number

Yes

(Empty)

ITEMTEXT="Document"

Specifies the text of the item to select. If the Action parameter selected is Select items at index, enter the index of the item to select here.

Select the target control by dragging the AutoMate icon to the desired object. Doing so will populate the Object Description section with the characteristics of the control. Click the Edit button to access/edit the following properties:

Window Title must be

Text

Yes

(Empty)

WINDOWTITLE="Microsoft Internet Explorer"

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.

NOTE: This action requires an object type, therefore, this parameter must be set to YES.

Object type (Text-box)

Text

Yes

(Empty)

OBJECTTYPE="PushButton"

Specifies the type of control that should be acted on. 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 acted on. 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 acted on. 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 acted on. 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 window. 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

Type

Req'd

Default

Markup

Description

Add Item to Current Selection

Yes/No

No

No

ADDTOSELECTION="YES"

If enabled, causes the item to be added to the current selection rather than replace it, similar to the effect of holding down the control key when selecting items in a list control.

 

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

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

 

Description: Get first item selected in list view: (class = "", name = "My List", type = "List", value = "*", X = "", Y = "", check class = "NO", check name = "YES", check type = "YES", check value = "YES", check position = "NO").  Populate variable "theVarName" with text item.  The object must be in the window : (title = "My List", class = "IEFrame").  

 

<AMGETSELECTEDLISTITEM WINDOWTITLE="My List" WINDOWCLASS="IEFrame" OBJECTNAME="My List" OBJECTVALUE="*" OBJECTTYPE="List" CHECKOBJECTNAME="YES" CHECKOBJECTVALUE="YES" CHECKOBJECTTYPE="YES" RESULTVARIABLE="theVarName" />