The Loop Windows action is used to perform some action on all open windows, or on a specified group of open windows. It loops through open windows and populates a variable with the window titles. The variable to populate must be created in an earlier step using the Create Variable action.
When you create a Loop Windows step, an End Loop step is created automatically. Place the steps to be performed on the windows between the Loop Windows step and the End Loop step. The steps within the block should be indented for visual clarity.
From the Task Builder Available Actions pane, open the Loop folder and double-click the Loop Windows action or drag it into the Steps pane.
In the Populate variable with window title box, select the variable to populate.
If you want to include invisible windows, select Include hidden windows.
Click the Advanced tab.
Use either the Include
windows or the Exclude windows
box to enter all or part of the window titles that you want to
include or ignore. You can use asterisk (*) and question mark (?) as wildcard
characters. For example *Microsoft Word
would specify all MS Word windows.
If you make an entry in the Include windows box, all windows that do not match your entry will be ignored. If you make an entry in the Exclude windows box, the specified windows will be ignored, and all other open windows will be included.
If you want to populate a variable with window handle data, select Populate variable with window handle, and then select the variable from the drop-down list. (The variable must be created in an earlier step using the Create Variable action.)
To place the window title, class, and handle in a dataset, 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.)
If you want the windows looped in ascending or descending alphabetical order, make your selection in the Sorting box.
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.
In the Task Builder Steps pane, hold down SHIFT and click the first and last steps in the block so that the complete block of steps is selected.
Click the Format button .
Adding Task Steps
Loop Windows Action