User Tools

Site Tools


trigger:Application

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
trigger:Application [2018/07/02 02:17]
JMichaelTX Needs Review
trigger:Application [2019/07/01 01:34]
peternlewis
Line 1: Line 1:
-{{:​trigger:​app-trigger-icon-km8.png?​nolink|}} 
- 
 ====== Application Trigger ====== ====== Application Trigger ======
  
 The //​Application trigger// allows you to execute a macro when an specified application (or any application) does any of the following: The //​Application trigger// allows you to execute a macro when an specified application (or any application) does any of the following:
  
-FIXME [JMichaelTx] ​ This needs testing/​confirmation:​ +Launches. 
- +Quits. 
-^ Trigger Type ^ Macro Group Type ^ +* Periodically while the application is running
-Launches ​| global | +* Activates
-Quits | app specific | +* Deactivates. 
-| Activates | app specific | +* Periodically while the application is at the front.
-| 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. An application Activates when it comes to the foreground, and deactivates when another application comes to the foreground.
Line 21: Line 14:
 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. 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.
  
-FIXME [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 Exceland it fired when Excel launched.+You can use the [[token:​TriggerValue|%TriggerValue% Text Token]] to determine the path of the application (previous to 9.0the `%TriggerValue%` token contained the name of the application).
  
-**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 practicethis means the Macro Groups ​that contain this trigger should be targeted at All Applications. +If a macro that is triggered by Acorn launching is in a macro group that is active only when Acorn is runningthen the trigger will probably never fire since the macro will be inactive until after the event has passed.  ​As suchmacros ​that are triggered by as application ​trigger should be in a macro group that is always ​active ​(or at leastmacro group that is active ​both before ​and after the event happens).
- +
-Be careful not to place macros with these triggers inside ​a macro group that is only active ​when the specified application is active. ​ Otherwiseby the time the macro itself becomes ​active, the application has already launched ​and activated and so the macro will not fire.+
  
 ===== See Also ===== ===== See Also =====
- 
----- 
  
 === Actions === === Actions ===
  
- * [[action:​Semaphore Lock|Semaphore Lock]] 
- * [[action:​Semaphore Reset|Semaphore Reset]] 
- * [[action:​Semaphore Unlock|Semaphore Unlock]] 
  * [[:​Actions|See all Actions]]  * [[:​Actions|See all Actions]]
  
 ===  Conditions === ===  Conditions ===
  
 +* [[condition:​Application|Application]] condition
 * [[:​Conditions|See all Conditions]] * [[:​Conditions|See all Conditions]]
  
 === Tokens === === Tokens ===
  
 +* [[token:​Application|%Application%]] token
 +* [[token:​ApplicationPath|%ApplicationPath%]] token
 +* [[token:​ApplicationBundleID|%ApplicationBundleID%]] token
 * [[:​Tokens|See all Tokens]] * [[:​Tokens|See all Tokens]]
  
Line 52: Line 42:
 === Triggers === === Triggers ===
  
 +* [[token:​TriggerValue|%TriggerValue%]] token
 * [[:​Triggers|See all Triggers]] * [[:​Triggers|See all Triggers]]
- 
----- 
  
 ==== Forum ==== ==== Forum ====
  
 - [[https://​forum.keyboardmaestro.com/​t/​application-dock/​4747|Application Dock]] - [[https://​forum.keyboardmaestro.com/​t/​application-dock/​4747|Application Dock]]
- 
 - [[https://​forum.keyboardmaestro.com/​search?​q=Application%20Trigger|Keyboard Maestro Forum topics about Trigger Application]] - [[https://​forum.keyboardmaestro.com/​search?​q=Application%20Trigger|Keyboard Maestro Forum topics about Trigger Application]]
trigger/Application.txt · Last modified: 2020/11/01 21:25 by peternlewis