Window Trigger

Description

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

Practical Usage

Useful in a back office (or unattended) environment to monitor the system for application generated error dialogs. These dialog boxes could be automatically handled when they appear. For example, a notification message could be sent to the system administrator upon the occurrence of an error.

Parameters

General properties

Drag the A icon to an open window to have AutoMate automatically detect its properties.

Property

Description

Action

The window 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 (disabled by default). 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.

Contents Properties

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.

Property

Description

Window must contain the objects

If enabled, allows you to define other window characteristics used to determine a matching window (disabled by default). 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 Properties

Property

Description

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 immediately launch the task as a result. If disabled, the trigger will ignore the open Notepad window upon startup. This parameter is disabled by default.

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. For example, if a Window trigger is set to monitor for the appearance of a Notepad window and this parameter is set to 3, the task will not launch until the third instance of Notepad appears on the desktop.

AMTrigger

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. The AMTrigger fields listed in the table below are specific only to Window triggers.

 

Name

Type

Return Value

AMTrigger.WindowTitle

Text

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

↑ Top of Page