User Tools

Site Tools


action:Execute_a_Shell_Script

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
action:Execute_a_Shell_Script [2021/10/18 03:55]
peternlewis [Path in Shell Scripts]
action:Execute_a_Shell_Script [2023/09/13 05:03]
peternlewis [Output of Results]
Line 41: Line 41:
 ==== Using Keyboard Maestro Variables ==== ==== Using Keyboard Maestro Variables ====
  
-=== Most Languages like bash, perl, ruby ===+Keyboard Maestro variables are included in the environment of the script, with the prefix `KMVAR_` and spaces in the name replaced with underscores (‗), 
 + 
 +By default, all variables are included, but you can select No Variables, or specific variables as desired using the popup menu next to the script (v11.0+). 
 + 
 +=== Most Shell Languages like bash ===
  
 In your script, use this format $KMVAR‗*VARIABLE‗NAME* where *VARIABLE‗NAME* is the name of your Keyboard Maestro Variable, but with spaces in the name replaced with underscores (‗). In your script, use this format $KMVAR‗*VARIABLE‗NAME* where *VARIABLE‗NAME* is the name of your Keyboard Maestro Variable, but with spaces in the name replaced with underscores (‗).
Line 140: Line 144:
   * Appended to a variable (v9.0+).   * Appended to a variable (v9.0+).
   * Saved to the system or a Named Clipboard.   * Saved to the system or a Named Clipboard.
 +  * Saved to a file.
   * Asynchronously ignored — the action runs while the macro continues on.   * Asynchronously ignored — the action runs while the macro continues on.
  
-If you want to return multiple values from a script, then you can either ​use AppleScript (via `osascript`) to [[manual:​Scripting#​AppleScript|set Keyboard Maestro variables]].+If you want to return multiple values from a script, then you can use AppleScript (via `osascript`) to [[manual:​Scripting#​AppleScript|set Keyboard Maestro variables]].
  
 ===== Examples ===== ===== Examples =====
Line 299: Line 304:
 === Actions === === Actions ===
  
 +* [[action:​Execute_a_Swift_Script|Execute a Swift Script]]
 * [[action:​Execute an AppleScript|Execute an AppleScript]] * [[action:​Execute an AppleScript|Execute an AppleScript]]
 * [[action:​Execute an Automator Workflow|Execute an Automator Workflow]] * [[action:​Execute an Automator Workflow|Execute an Automator Workflow]]
action/Execute_a_Shell_Script.txt · Last modified: 2023/09/22 04:39 by peternlewis