Window Condition

See Also

Setting a Window Condition, About Conditions, All Available Conditions, Using AMTrigger, Using AMCondition

Description

Starts the task when the specified window opens, closes, is focused or loses focus. Can also be used in the middle of a workflow to wait for a window to open, close, focus or lose focus or determine the path of a workflow depending on whether a window is open, close, focused or not focused.

Practical Usage

Useful in a "back office" (or unattended) environment for monitoring the system for application generated error dialogs. These dialog boxes could be automatically handled when they occur and/or a notification message could be sent to the system administrator.

General Tab

 

Action

Specifies the action to monitor. The available options are:

Wait for window to open (default) - The trigger will monitor for the specified window to open.

Wait for window to close - The trigger will monitor for the specified window to close.

Wait for window to be focused - The trigger will monitor for the specified window to become focused (or appears in the foreground).

Wait for window to not be focused - The trigger will monitor for the specified window to lose focus.

 

Triggers once when the window is first open.

If enabled, specifies that the action to be performed on the window being monitored will occur only once when that window first opens and ignore other instances. For example, if this trigger is set to wait for Notepad to close, enabling this option tells the trigger to watch for the first instance of Notepad to open and activate only when that first instance closes. If a second instance of Notepad opens and closes before the first instance, that action is ignored.

 

Window title must be

If enabled, specifies the title of the window to monitor. The value is not case sensitive. This parameter supports wildcard characters (* and ?). For example, entering *Internet Explorer* would include all windows containing Internet Explorer (enabled by default).

 

Window class must be

If enabled, specifies the class of the window to monitor. A window class is a set of attributes that the system uses as a template to create a window. Every window is a member of a window class. All window classes are process specific. The value is not case sensitive. This parameter supports wildcard characters (* and ?). For example, entering *Explore* would include all window classes containing Explore. (disabled by default)

 

Window handle must be

If enabled, specifies the handle of the window to monitor. A window handle is code that uniquely identifies an open window. (disabled by default)

 

Window is a child window

If enabled, specifies that the window to monitor is a child window. A child window is normally a secondary window on screen that is displayed within the main overall window of the application. This option is available only when the Action parameter is set to Wait for window to be focused or Wait for window to not be focused.

 

Drag -->

Drag this icon to an open window to have AutoMate automatically detect that window's properties.

AMTrigger Parameters

When this condition is used as a trigger, it automatically passes the "AMTrigger" object to the task. AMTrigger can be used within a task to determine whether or not the task was started by a trigger, which trigger started the task, when the trigger was activated and other trigger related properties. For more details, see Using AMTrigger.

 

Common AMTrigger Fields

Every instance of AMTrigger populates a list of common fields which are described in the table below.

Name

Data Type

Return Value

AMTrigger.Trigger

String

Returns the name of the event or condition that triggered the task. Each event or condition contains a unique name. For this trigger, the value is always AMWINDOWTRIGGER.

AMTrigger.TaskName

String

Returns the name of the managed task that the trigger was attached to. Useful to determine the responsible task when two managed tasks point to the same AML file.

AMTrigger.TriggerredDateTime

String

Returns the date and time when the trigger occurred.

AMTrigger.TriggeredOn

String

Returns the machine name where the trigger occurred.

AMTrigger.WasLocked

Boolean

If the workstation was locked when the trigger occurred, the value returned is 1. Otherwise, it will be 0.

AMTrigger.WasLoggedOff

Boolean

If the workstation was logged off when the trigger occurred, the value returned is 1. Otherwise, it will be 0.

AMTrigger.AML

String

Returns a verbose set of information about the triggered event or condition in AML (AutoMate Markup Language) format.

 

Specific AMTrigger Fields

The AMTrigger fields listed in the table below are specific only to the Window and Key triggers.

Name

Data Type

Return Value

AMTrigger.WindowClass

String

Specifies the title of the window in the foreground when the trigger was activated.

AMTrigger.WindowHandle

Number

Specifies the handle of the window in the foreground when the trigger was activated. 

 

NOTE: A full list of AMTrigger objects exclusive to each trigger can be viewed from the Expression Builder by expanding Objects -> Triggers and selecting the desired trigger.

 

AMCondition Parameters

When this condition is activated during the path of a workflow, it automatically passes the AMCondition object to the task.

Common AMCondition Fields

Each condition contains its own set of unique AMCondition values. Therefore, the total number of fields that AMConditon creates during runtime and what they are called depend largely on the condition that was activated. However, every instance of AMCondition is populated with the following general fields:

Name

Data Type

Return Value

AMCondition.Agent

String

Returns the name of the agent where the condition activated.

AMCondition.DateTime

String

Returns the date and time of when the condition occurred.

AMCondition.Name
 

String

Returns the name of the activated condition. Each condition contains a unique name. For example, if the File condition was initiated, the value returned would be . See the help topic for each condition to determine that object's unique name.

AMCondition.Result
 

String

Returns the result of the activated condition (True or False).

AMCondition.WasLocked

Boolean

If the workstation was locked when the condition occurred, the value returned is 1. Otherwise, it will be 0.

AMCondition.WasLoggedOff

Boolean

If the workstation was logged off when the condition occurred, the value returned is 1. Otherwise, it will be 0.

AMCondition.AML

String

Returns verbose data about the activated condition in AutoMate Markup Language (AML) format.

 

Specific AMTrigger Fields

The AMTrigger fields listed in the table below are specific only to the Window and Key triggers.

Name

Data Type

Return Value

AMCondition.WindowClass

String

Specifies the title of the window in the foreground when the trigger was activated.

AMCondition.WindowHandle

Number

Specifies the handle of the window in the foreground when the trigger was activated. 

See Also

About Events & Conditions

All Available Events & Conditions

Condition_Behavior