Loop - List control

Declaration

<AMLOOP ACTIVITY="listcontrol" WINDOWTITLE="text" WINDOWCLASS="text" ACCESSIBILITYENGINE="text (options)" OBJECTPROPERTIES="Toolkit=text,Type=text,Class=text,FrameworkId=text,Name=text,AutomationId=text,Value=text,Role=text,Description=text,X=number,Y=number,Width=number,Height=number,IndexInParent=text,ParentPath=text,Occurrence=number" INCLUDE="text" EXCLUDE="text" SORT="text (options)" RESULTVARIABLE="text" RESULTDATASET="text" />

Related Topics   

Description

Loops through the items of a list box or list view and populates a variable with the current item text. With each successive loop, the next item is retrieved. The loop ends after all the elements have been browsed or when a Break is encountered.

NOTE: Only standard Windows list controls will work with the Loop List Control action. Many applications use images or other controls that may act like list controls but they are not native Windows controls—the Loop List Control Action will not work with these controls.

Practical usage

Used to perform some action an all items in a list box or list view.

Parameters

General

This activity comprises Automate Desktop's Window Dissection technology to facilitate the discovery of existing window objects and controls. To select the target control:

  1. Make certain the window that contains the desired control is open and in the foreground (in front of all other open windows).
  2. Drag and release the magnifier icon over the control. If the control is supported by this activity, a green border will appear around it.
  3. Upon release, the Edit portion of the editor is populated with identified control properties. Individual properties can be enabled / disabled and their values can be further modified. The values for all disabled properties will be lost at the time the activity is saved.
Property Type Required Default Markup Description
Store item text in variable Text Yes (Empty) RESULTVARIABLE="varname" The variable that should be populated with the current item from the specified tree control.

Edit

 
PropertyTypeRequiredDefaultMarkupDescription
By window titleTextYes(Empty)WINDOWTITLE="Microsoft Internet Explorer"If enabled, specifies the title of the window that the control search should be restricted to. If disabled, this parameter is ignored. Click the down arrow to select a title from the drop-down list that appears, or enter a title manually in the provided text box. This parameter supports wildcard characters (that is, * and ?). For example, entering *Internet Explorer* would restrict the search to only windows containing the text "Internet Explorer" in its title.
By window classTextNo(Empty)WINDOWCLASS="Outlook Express Browser Class"If enabled, specifies the class of the window that the control search should be restricted to. If disabled, this parameter is ignored. Click the down arrow to select a window class from the drop-down list that appears, or enter a window class manually in the provided text box. This parameter supports wildcard characters (that is, * and ?). For example, entering *Internet Explorer* would restrict the search to only window classes containing the text "Internet Explorer."
By window handleNumberNo(Empty)WINDOWHANDLE="555735"If enabled, specifies the handle of the window that the control search should be restricted to. If disabled or set to 0, this parameter is ignored. Use this parameter as a way to distinguish a particular window from other instances containing an identical title / class.
Accessibility engineText (options)NoAuto
  • ACCESSIBILITYENGINE="auto"
  • ACCESSIBILITYENGINE="ui_automation"
  • ACCESSIBILITYENGINE="active"
  • ACCESSIBILITYENGINE="java"
  • ACCESSIBILITYENGINE="ie"
The accessibility engine that this activity will use to programmatically gather accurate information about a user interface in order to interact with it. The available options are:
  • Auto - Starting with UI Automation, Automate Desktop detects which accessibility engine to use based on the control's properties.
    NOTE: Some controls may not be compatible with this option and will require one of the other accessibility engine options to be manually selected for best results.
  • UI Automation - UI Automation will be used, which is Microsoft's standard for exposing information about its user interface.
  • Active - Active Accessibility will be used, which uses an older Microsoft engine for exposing information about its user interface.
  • Java - Java Access Bridge will be used, which is a technology that enables certain Java applications and applets to be visible to assistive technologies on Microsoft Windows systems.
  • Internet Explorer - Internet Explorer DOM will be used, which is the Document Object Model used to represent objects in a web page (that is, text, images, headers, links, etc.).
BrowseButtonNo----Provides the option to manually traverse the list of available controls for a window that was selected either by the magnifier icon, or manually by the By window title property.

In some cases, the desired control cannot be selected using the magnifier icon. If this occurs, use the magnifier icon to select any control, and then click Browse. Select the desired control from the list in the Object Browser, and then click OK. The Object properties for the selected control will now be populated.

Controls can also be selected without the aid of the magnifier icon by enabling the By window title property, and then manually selecting the window the desired control is located in from the list. After selecting a window, click Browse. Select the desired control from the list in the Object Browser, and then click OK. The Object properties for the selected control will now be populated.

NOTE: It is not recommended to select a control without using the magnifier icon. Doing so may result in selecting a control that isn't supported by this activity and cause the step to fail when attempting to run it.
Object propertiesTextNo(Varies)OBJECTPROPERTIES="Toolkit
=WindowsAccessibility,Type=data,
Class=DockingPane,Name=Line,
Value=text,X=300,Y=200"
Contains standard Window Dissection parameters used to describe objects, controls, or text inside a window. This section can be used to define additional characteristics in order to precisely designate a window or matching object. To enable / disable a specific property, check or uncheck its associated checkbox. To modify the value of a specific property simply enter the desired value in the Value field.
ToolkitTextNo(Empty)
  • TOOLKIT=UIAutomation
  • TOOLKIT=WindowsAccessibility
  • TOOLKIT=JavaAccessibility

If enabled, specifies that the toolkit (a set of basic building units for graphical user interfaces) will be examined when determining a matching object. If disabled, the toolkit will be ignored.

The toolkit that appears is based on the Accessibility engine used:

  • UI Automation - UIAutomation
  • Active - WindowsAccessibility
  • Java - JavaAccessibility
  • Internet Explorer - WindowsAccessibility
TypeTextNo(Empty)TYPE=PushButtonIf enabled, specifies that the object's type (that is, Button, Checkbox, Trackbar) will be examined when determining a matching object. If disabled, the type will be ignored.
ClassTextNo(Empty)CLASS=SysTreeView32If enabled, specifies that the object's class (that is, XTPToolBar, SysTreeView, MDIClient) will be examined when determining a matching object. If disabled, the class will be ignored.
FrameworkIdTextNo(Empty)FRAMEWORKID=WPFIf enabled, specifies that the object's framework ID (the framework technology used to create the object) will be examined when determining a matching object. If disabled, the framework ID will be ignored.
NameTextNo(Empty)NAME=CancelIf enabled, specifies that the object's name (a unique identifier for an object) will be examined when determining a matching object. If disabled, the name will be ignored.
AutomationIdTextNo(Empty)AUTOMATIONID=SystemIf enabled, specifies that the object's automation ID (a unique identifier for an object) will be examined when determining a matching object. If disabled, the automation ID will be ignored.
ValueTextNo(Empty)VALUE=1If enabled, specifies that the object's value (which usually coincides with the Name property) will be examined when determining a matching object. If disabled, the value will be ignored.
RoleTextNo(Empty)ROLE=desktop paneIf enabled, specifies that the object's role type (the control type provided by the Java Accessibility bridge) will be examined when determining a matching object. If disabled, the role type will be ignored.
DescriptionTextNo(Empty)DESCRIPTION=JScrollPaneIf enabled, specifies that the object's description (the description given for an object) will be examined when determining a matching object. If disabled, the description will be ignored.
XNumberNo(Empty)X=80If enabled, specifies that the object's X coordinate (a given number of pixels along the horizontal axis of a window starting from the extreme left side) will be examined when determining a matching object. If disabled, the X coordinate will be ignored.
NOTE: The X and Y coordinates are relative to the specified window as opposed to the screen.
YNumberNo(Empty)Y=90If enabled, specifies that the object's Y coordinate (a given number of pixels along the vertical axis of a window starting from the top-most portion) will be examined when determining a matching object. If disabled, the Y coordinates will be ignored.
NOTE: The X and Y coordinates are relative to the specified window as opposed to the screen.
WidthNumberNo(Empty)WIDTH=711If enabled, specifies that the object's pixel width will be examined when determining a matching object. If disabled, the pixel width will be ignored.
HeightNumberNo(Empty)HEIGHT=421If enabled, specifies that the object's pixel height will be examined when determining a matching object. If disabled, the pixel height will be ignored.
IndexInParentTextNo(Empty)INDEXINPARENT=1If enabled, specifies that the object's index in parent number (the numeric identifier of a child object located within a parent object) will be examined when determining a matching object. If disabled, the index in parent number will be ignored.
ParentPathTextNo(Empty)PARENTPATH=50032|50033If enabled, specifies that the object's parent path (the sequence of control type identifiers that lead to the object) will be examined when determining a matching object. If disabled, the parent path will be ignored.
OccurrenceNumberNo(Empty)OCCURRENCE=1If enabled, specifies that the object's occurrence (the numeric identifier of an object, useful when multiple matching objects are found) will be examined when determining a matching object. If disabled, the occurrence will be ignored.

Advanced

 
PropertyTypeRequiredDefaultMarkupDescription
Include itemsTextNo(Empty)INCLUDE="d*"Specifies a wildcard mask representing the items to include in the loop. For example, specifying D* returns only items that begin with the letter "D".
Exclude itemsTextNo(Empty)EXCLUDE="z*"Specifies a wildcard mask representing the items to exclude from the loop. For example, specifying Z* returns no items that begin with the letter "Z".
Create and populate datasetTextNo(Empty)RESULTDATASET="DatasetName"Specifies the name of a dataset to be created and populated with data from the looped list. The dataset will contain a column for each column in the list control plus an index column for the index number of the list item.
List presortingText (options)NoNone
  • SORT="ascending"
  • SORT="descending"
Specifies the sort order to be applied to the values before the loop begins. The available options are:
  • No sorting - Results left in their natural order and not sorted.
  • Sort in ascending alphabetical order - Results sorted in ascending alphabetical order (A to Z).
  • Sort in descending alphabetical order - Results sorted in descending alphabetical order (Z to A).

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This task loops through items of a list. Within each iteration, a Speak action speaks out loud the current item on the list.

Copy
<AMVARIABLE NAME="VariableName1" VALUE="" />
<AMSPEECH TEXT="These are the items on the list" VOLUME="100" SPEED="50" />
<AMLOOP ACTIVITY="listcontrol" WINDOWTITLE="My Documents" OBJECTPROPERTIES="Type=List,Name=,Value=,Class=SysListView32,X=204,Y=119" EXCLUDE="*.txt" SORT="ascending" RESULTVARIABLE="VariableName1" RESULTDATASET="DatasetName" />
<AMSPEECH VOLUME="100" SPEED="50">%VariableName1%</AMSPEECH>
<AMLOOP ACTIVITY="end" />