If Window Exists Action—Setting Properties

The If Window Exists action is used to set up conditional steps that will be performed only if a specified window is in a specified condition. If the window is not in the specified condition, the task goes to the End If step or to the next Else step.

When you create an If Window Exists step, an End If step is created automatically. Place the steps to be preformed if the condition is met between the If Window Exists step and the End If step. Steps within the block should be indented for visual clarity.

You can define the window as specifically or as generally as you like. If more than one window matches the properties entered, the first window to meet the specified condition causes the steps to be executed. By default only visible windows are included, but the action can be set to include hidden windows.

You can also populate variables or a dataset with the properties of the window. Any variables used must be created in earlier steps using the Create Variable action.  

To set If Window Exists properties

  1. From the Task Builder Available Actions pane, open the Flow folder and double-click the If Window Exists action or drag it into the Steps pane.

  2. In the If box, select from the following:

  3. If possible, open the window that you want the step to look for. Then drag the AutoMate icon into the window. This will automatically populate the window properties. If you cannot open the window, use a similar window and then edit the properties per step 4 below.

  4. Select or clear the check boxes to indicate which window properties are required.

  5. If you need to make changes to the auto-populated properties, use the following guidelines:

  6. To specify one or more objects to be used in identifying the window, click the Contents tab, select Window must contain the objects, and then enter the properties for each object as follows:

    1. Click Add and then drag the AutoMate icon to the object.

    2. If you need to edit the auto-populated properties, click Edit. Then edit the properties according to the following guidelines:

The properties are as follows:

  1. Click OK to return to the Contents page.

    All entered objects are listed.

  2. If you need to delete an object, select it on the list and click Delete.

  3. To designate variables or a dataset to be populated with the window properties, click the Advanced tab and enter the properties as follows:

    1. If the window you want the step to look for will be hidden when the step runs, select Include hidden windows.

    2. For each property that you want to place in a variable, select the check box and then select the variable in the box below.

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

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

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

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

See Also

About Actions

Adding Task Steps

Window Dissection Parameters

If Windows Exists Action