User Tools

Site Tools


manual:Scripting

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
Next revision Both sides next revision
manual:Scripting [2021/10/06 02:35]
peternlewis [Using the Clipboard]
manual:Scripting [2023/09/12 22:43]
peternlewis [Controlling Keyboard Maestro Engine via Scripting]
Line 132: Line 132:
 </​code>​ </​code>​
  
-The CODE{{{do script}}} will not return until the macro is finished executing.+The CODE{{{do script}}} will not return until the macro is finished executing. The [[action:​Return_Result|Return Result]] action can be used to return a result to the AppleScipt.
  
 You can pass an optional parameter using the CODE{{{with parameter}}} clause, which you can read in the macro as the [[token:​TriggerValue|%TriggerValue% token]]. You can pass an optional parameter using the CODE{{{with parameter}}} clause, which you can read in the macro as the [[token:​TriggerValue|%TriggerValue% token]].
Line 170: Line 170:
 end tell end tell
 </​code>​ </​code>​
 +
 +or process tokens with:
 +
 +<code applescript>​
 +tell application "​Keyboard Maestro Engine"​
 +  process tokens "​%LongDate%"​
 +end tell
 +</​code>​
 +
 +The `calculate` and `process tokens` commands can also take an `instance` parameter (v10.0+) to specify the instance for local variable access.
  
 You can ask Keyboard Maestro Engine to find strings in other scripts: You can ask Keyboard Maestro Engine to find strings in other scripts:
manual/Scripting.txt ยท Last modified: 2023/10/04 04:27 by peternlewis