The Application trigger allows you to execute a macro when an specified application (or any application) does any of the following:
[JMichaelTx] This needs testing/confirmation:
Trigger Type | Macro Group Type |
---|---|
Launches | global |
Quits | app specific |
Activates | app specific |
Deactivates | app specific |
Is Running (the macro executes repeatedly). | app specific |
Is Active (the macro executes repeatedly). | app specific |
Of course, all macros are active when in a global (Available in all applications) macro group, but a macro with the Launches trigger must be in a global group.
An application Activates when it comes to the foreground, and deactivates when another application comes to the foreground.
You could use a trigger like this to simulate workspaces by automatically setting up an application the way you want when you launch it, or you could clean up after an application when you quit.
[JMichaelTx] The below is inconsistent with my testing. I just created a Macro to trigger on Excel activation, in a Macro Group available ONLY in Excel, and it fired when Excel launched.
Caution: As with all triggers, the trigger will fire only if the Macro Group that contains it is active, which is based on the current foreground application before the specified application launches, or after the specified application is deactivated or quits. In practice, this means the Macro Groups that contain this trigger should be targeted at All Applications.
Be careful not to place macros with these triggers inside a macro group that is only active when the specified application is active. Otherwise, by the time the macro itself becomes active, the application has already launched and activated and so the macro will not fire.