User Tools

Site Tools


token:TriggerValue

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
token:TriggerValue [2017/11/06 01:34]
peternlewis
token:TriggerValue [2019/09/16 11:31] (current)
JMichaelTX ADD info about Execute a Macro
Line 7: Line 7:
 * You can pass an explicit value in when executing the macro via the web server. * You can pass an explicit value in when executing the macro via the web server.
 * You can pass an explicit value in when executing the macro via the [kmtrigger URL](trigger:​URL). * You can pass an explicit value in when executing the macro via the [kmtrigger URL](trigger:​URL).
-It will reflect ​the exact text you typed to trigger ​[Typed String trigger](trigger:​Typed_String)+ 
-* It will reflect the current modifiers when triggering a macro via the Status Menu or Palette (Note that Option means "edit this macro instead of triggering it"​). +**When a Macro is triggered, the The //​%TriggerValue%//​ token value will be based on the trigger:** 
-* It will reflect the hot key or device ​key pressed. + 
-* It will reflect the application name for an application trigger. +^ Trigger Type ^ `%TriggerValue%` token ^ 
-* It will reflect the name of the file added/removed ​from folder.+[Typed String trigger](trigger:​Typed_String) ​the exact text you typed to trigger | 
 +| [[trigger:​Status_Menu|Status Menu]] or [[manual:​Palettes|Palette]] | the current modifiers ​(Note that Option means "edit this macro instead of triggering it"​). ​| 
 +| [[trigger:​Hot_Key|Hot Key Trigger]] ​or [[trigger:​USB_Device_Key|USB Device Key]] | The key that was pressed. ​| 
 +| [[trigger:​Application|Application Trigger]] | application name | 
 +| [[trigger:​Folder|Folder Trigger]] | path of the file that was added or removed ​
 +| [Execute a Macro action](action:​Execute_a_Macro) | Although _Execute a Macro_ is _not_ technically a trigger, when a Macro is executed by this method (the "​Sub-Macro"​),​ the //​%TriggerValue%//​ token (as evaluated in the "​Sub-Macro"​) will be either of two values:\\ 1. The //​%TriggerValue%//​ of the calling ("​Main"​) Macro\\ OR \\ 2. The value of the Parameter of the _Execute a Macro_, **if** ​Parameter is provided|
  
 To use the %TriggerValue% token in a numeric field, use the [CALCULATE](https://​wiki.keyboardmaestro.com/​function/​CALCULATE) function: CALCULATE(%TriggerValue%). To use the %TriggerValue% token in a numeric field, use the [CALCULATE](https://​wiki.keyboardmaestro.com/​function/​CALCULATE) function: CALCULATE(%TriggerValue%).
  
 You can easily access the individual parts using the token array notation, eg `%TriggerValue[3]%` will be the third comma-separated value, and `%TriggerValue[3];​%` will be the third semicolon-separated value, and `%TriggerValue[3] %` (note the space between the `]` and the `%`) will be the third space-separated value (8.0.4+). You can easily access the individual parts using the token array notation, eg `%TriggerValue[3]%` will be the third comma-separated value, and `%TriggerValue[3];​%` will be the third semicolon-separated value, and `%TriggerValue[3] %` (note the space between the `]` and the `%`) will be the third space-separated value (8.0.4+).
token/TriggerValue.1509950047.txt.gz · Last modified: 2017/11/06 01:34 by peternlewis