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
Previous revision
trigger:Application [2016/08/28 11:06]
alain JMTX template + add forum link & internal links + forum Google search
trigger:Application [2020/11/01 21:25] (current)
peternlewis
Line 1: Line 1:
 +====== 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:
  
-* Launches +* Launches. 
-* Quits +* Quits. 
-* Is Running (the macro executes repeatedly). +* Is Running (and periodically while it remains running). 
-* Activates +* Activates. 
-* Deactivates +* Deactivates. 
-* Is Active (the macro executes repeatedly).+* Is Active (and periodically while it remains at the front).
  
 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.
 +
 +The `Is Running` and `Is Active` variant will trigger once when the application first launches/​activates,​ and then periodically thereafter while the application continues to run/remains at the front.
  
 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.
  
-**Caution**As with all triggers, ​the trigger will fire only if the Macro Group that contains it is activewhich 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.+You can use the [[token:TriggerValue|%TriggerValue% Text Token]] to determine ​the path of the application (previous to 9.0, the `%TriggerValue%` token contained ​the name of the application).
  
-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.+(!) If a macro that is triggered by an application launching is in a macro group that is active ​only when that application is running or active, then 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 leasta macro group that is active both before ​and after the event happens).
  
 ===== 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
 +* [[token:​Trigger|%Trigger%]]
 +* [[token:​TriggerBase|%TriggerBase%]]
 +* [[token:​TriggerValue|%TriggerValue%]]
 * [[:​Tokens|See all Tokens]] * [[:​Tokens|See all Tokens]]
- 
-==== Topics ==== 
- 
-* [[:​Frequently Asked Questions|FAQ]] 
  
 === Triggers === === Triggers ===
  
 * [[:​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://www.google.fr/search?q=site:​forum.keyboardmaestro.com+Application+Trigger|Keyboard Maestro Forum topics about Trigger Application]] +
- +
-==== External References ==== +
trigger/Application.1472396770.txt.gz · Last modified: 2016/08/28 11:06 by alain