Loop Windows Action
TYPE="WINDOWS" RESULTVARIABLE="text [variablename]"
ALLOWHIDDEN="yes/no" INCLUDE="text" EXCLUDE="text"
SORT="text [options]" WINDOWHANDLEVARIABLE="text [variablename]"
Loops through all of the windows that are currently open on the system. The variable specified is updated with the current window title, and with each successive loop, the next window title is retrieved. The loop ends after all the open windows have been retrieved or when a Break is encountered.
To perform an action on every window that is open on the system.
Specifies an already created variable name that should be populated with the next window title on each successive loop.
Specifies that invisible (hidden) windows should be included in the loop results.
Specifies a wildcard mask to designate the titles of windows to be included in the loop. For example, if "*Internet Explorer" was specified, the loop would only include window titles ending with the text Internet Explorer. Use asterisk (*) or question mark (?) as wildcard characters.
Specifies a wildcard mask to designate the titles of the windows to be excluded from the loop. For example, if "*Internet Explorer" was specified, the loop would include all window titles except those ending with the text Internet Explorer. Use asterisk (*) or question mark (?) as wildcard characters.
Specifies an already existing variable to be populated with the current window handle.
Specifies the name of a dataset to be created and populated with data from each of the windows. In addition to the standard dataset fields, the dataset will contain the following:
Title: the window title
Class: the window class
Handle: the window handle
Specifies whether a sort order should be applied to the values before the loop begins. For example, selecting "ascending" would return the window titles in alphabetical order.
The available options are:
none: The results are left in their natural order and not sorted.
ascending: The results sorted in ascending alphabetical order (A-Z).
descending: The results sorted in descending alphabetical order (Z-A).
This action contains a subset of Network Automation's unique "Window Dissection Technology".
Click here for more information.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
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
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<!-- Close all windows containing the text Internet Explorer
<<AMLOOP TYPE="WINDOWS" RESULTVARIABLE="currentwindow" WINDOWHANDLEVARIABLE="" INCLUDE="*Internet Explorer">
<!-- List all open Word documents -->
<AMSPEAK ENGINE="automatic">These are your open documents.</AMSPEAK>
<AMLOOP TYPE="WINDOWS" RESULTVARIABLE="VariableName" INCLUDE="*.doc*" SORT="ascending" RESULTDATASET="DatasetName">