Window Trigger

See Also

Introduction to Triggers, Available Triggers, Using AMTrigger, Setting a Window Watcher Trigger

Description

Triggers the task when the specified window opens, closes, is focused or loses focus.

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

Contents Tab  

The Contents tab contains standard window dissection parameters (i.e. object name, type, class, value and position) used to describe controls or text in a window. These options are useful in determining windows with identical titles as documented under Window Dissection parameters.

To select an object from an existing window, click Add and either use the Browse button or drag the hand icon to the area on the screen. Then use the Edit button to edit specific properties.

Behavior Tab

Trigger on startup if condition is true

If enabled, the system will act upon conditions that already exist upon startup of the current trigger. For example, if the Notepad window is already open on the desktop, a newly created Window trigger set to monitor for the existence of a Notepad window will trigger the task as a result. If disabled, the trigger will ignore the open Notepad window upon startup.

Trigger after the condition has been met 'X' times.

If enabled, specifies how many times the trigger condition must be met before the task is started (disabled by default). This parameter is available in all triggers except the Schedule Trigger.

AMTrigger Parameters

When this trigger is activated, 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.

See Also

Setting a Window Watcher Trigger

About Triggers

All Available Triggers

Using AMTrigger