Key Trigger

See Also

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

Description

Triggers the task when a hot-key combination is pressed or a specific word is typed on the keyboard.

Practical Usage

Useful for creating hot-key "shortcuts" for repetitive multi-step processes.

Parameters

General Tab

 

Trigger on the following hot key

If selected, specifies the hot key combination to be monitored. Selecting this parameter enables the following secondary parameter.

 

Allow hot key to pass through to application

If enabled, specifies that the hot-key combination will continue to be active in an open application. If disabled, the hot key combination will have no effect on any application other than AutoMate (disabled by default)

 

Trigger on the following autokeys

If selected, specifies that the trigger will monitor for the specified word or phrase to be typed. Selecting this parameter enables the following secondary parameter.

 

Erase text before triggering task

If enabled, the monitored text will erase itself from any document or application before triggering the task. However, if you want the typed text to appear in the open application or document, disable this parameter.

 

Only when the following process is active

If selected, the trigger will activate only when the selected process is active on the system during the time that a user enters the specified hot key, word or phrase (disabled by default). Selecting this parameter enables the following secondary parameter.

 

And the application is in the foreground

If selected, the trigger will activate only when the selected process is active and the application window corresponding to that process is currently in the foreground during the time that a user enters the specified hot key, word or phrase.

 

Behavior Tab

 

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

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 Key and Window triggers.

 

Name

Data Type

Return Value

AMTrigger.Keys

 

String

Returns the hotkeys or autokeys that activated the trigger.

AMTrigger.WindowTitle

Text

Specifies the title of the Window in the foreground when the Key trigger was activated.

AMTrigger.WindowHandle

Number

Specifies the handle of the Window in the foreground when the Key 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 Key Watcher Trigger

About Triggers

All Available Triggers

Using AMTrigger