User Tools

Site Tools


action:Execute_an_AppleScript

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
action:Execute_an_AppleScript [2018/07/02 19:39]
JMichaelTX [Setup] Update Options table
action:Execute_an_AppleScript [2019/11/26 21:57]
peternlewis [Scripting]
Line 1: Line 1:
-{{:​scripting-icon.png?​nolink|}} 
 ====== Execute AppleScript Action ====== ====== Execute AppleScript Action ======
  
Line 13: Line 12:
 ^ Setup Option ^ Choices\\ (Default shown first) ^ ^ Setup Option ^ Choices\\ (Default shown first) ^
 | Script location | Execute text script (type or paste script into Action text field)\\ Execute script file (This is faster if it is a compiled script file `.scpt`) | | Script location | Execute text script (type or paste script into Action text field)\\ Execute script file (This is faster if it is a compiled script file `.scpt`) |
-| Script Results | Ignored.\\ Displayed in a floating window.\\ Displayed briefly in a Notification.\\ Typed in the current text field that has focus.\\ Pasted in text field that has focus.\\ Saved to a Keyboard Maestro Variable.\\ Saved to the System or Named Clipboard.\\ Ignore Results and run //​Asynchronously//​ (the script runs while the macro continues on to the next //​Action//​.) |+| Script Results | Ignored.\\ Displayed in a floating window.\\ Displayed briefly in a Notification.\\ Typed in the current text field that has focus.\\ Pasted in text field that has focus.\\ Saved to a Keyboard Maestro Variable.\\ Saved to the System or Named Clipboard.\\ Ignore Results and run //​Asynchronously//​ (the script runs while the macro immediately ​continues on to the next //​Action//​.) |
  
  
Line 25: Line 24:
 {{:​action:​execute-applescript-example-km8.png?​nolink|}} {{:​action:​execute-applescript-example-km8.png?​nolink|}}
  
----+If the script fails, the action will fail (v9.0+), potentially aborting the macro.
  
 ===== Scripting ===== ===== Scripting =====
  
-For the latest update on this topic, see the User Manual article: [[manual:​Scripting|Scripting]]. ​ +For the latest update on this topic, see the User Manual article: [[manual:​Scripting|Scripting]]. ​
 This provides the latest method to get and set Keyboard Maestro variables via AppleScript. This provides the latest method to get and set Keyboard Maestro variables via AppleScript.
  
Line 45: Line 44:
  
 ``` ```
- 
---- 
  
 ===== Using Keyboard Maestro Variables ===== ===== Using Keyboard Maestro Variables =====
Line 63: Line 60:
 tell application "​Keyboard Maestro Engine"​ to set myVar to getvariable "My KM Variable"​ tell application "​Keyboard Maestro Engine"​ to set myVar to getvariable "My KM Variable"​
 </​code>​ </​code>​
---- 
  
 **Using Keyboard Maestro Variables in a Shell Script from AppleScript** **Using Keyboard Maestro Variables in a Shell Script from AppleScript**
action/Execute_an_AppleScript.txt ยท Last modified: 2019/11/26 21:57 by peternlewis