Loop Windows Action—Setting Properties

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.

To set Loop Windows properties

  1. 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.

  2. In the Populate variable with window title box, select the variable to populate.

  3. If you want to include invisible windows, select Include hidden windows.

  4. Click the Advanced tab.

  5. 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.  

  6. 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.)

  7. 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.)

  8. If you want the windows looped in ascending or descending alphabetical order, make your selection in the Sorting box.

  9. To set the Description tab properties, refer to Description Tab Options.

  10. To set the Error Causes and On Error tab properties, refer to Step Error Handling.

  11. When finished, click OK to save settings and close the properties dialog window.

To auto-indent after all steps are added

  1. 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.

  2. Click the Format button .

See Also

About Actions

Adding Task Steps

Loop Windows Action