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 [2019/05/03 23:54]
peternlewis [Quoting Strings]
action:Execute_a_Shell_Script [2019/07/01 02:46]
peternlewis [Execute a Shell Script]
Line 1: Line 1:
-{{:​action:​shell-script-icon.png?​nolink|}} 
 ====== Execute a Shell Script ====== ====== Execute a Shell Script ======
  
Line 9: Line 8:
  
 {{:​action:​execute-shell-script.png?​nolink&​693|}} {{:​action:​execute-shell-script.png?​nolink&​693|}}
 +
 +If the script fails, the action will fail (v9.0+), potentially aborting the macro.
  
 ==== Using Keyboard Maestro Variables ==== ==== Using Keyboard Maestro Variables ====
Line 35: Line 36:
  
 See the [[#​Forum|Forum]] section below for more Python examples. See the [[#​Forum|Forum]] section below for more Python examples.
- 
---- 
  
 Note that you can only read these environment variables. ​ You cannot write to them (or more accurately, you can write to them but that will not change the Keyboard Maestro variables that they were created from). Note that you can only read these environment variables. ​ You cannot write to them (or more accurately, you can write to them but that will not change the Keyboard Maestro variables that they were created from).
Line 73: Line 72:
   * [[https://​forum.keyboardmaestro.com/​t/​png-metadata-comment/​6375/​29| How To Quote Paths by @ccstone]].   * [[https://​forum.keyboardmaestro.com/​t/​png-metadata-comment/​6375/​29| How To Quote Paths by @ccstone]].
   * [[https://​forum.keyboardmaestro.com/​t/​trouble-expanding-variable-in-shell-script/​13664/​2?​u=jmichaeltx | Trouble Expanding Variable in Shell Script by @PeterNLewis]]   * [[https://​forum.keyboardmaestro.com/​t/​trouble-expanding-variable-in-shell-script/​13664/​2?​u=jmichaeltx | Trouble Expanding Variable in Shell Script by @PeterNLewis]]
- 
---- 
  
 ==== UTF-8 and Non-ASCII Characters ==== ==== UTF-8 and Non-ASCII Characters ====
  
 If you are dealing with non-ASCII characters, you probably want to set the `LC_ALL` environment variable to UTF8, which you can do by setting the Keyboard Maestro variable `ENV_LC_ALL` to “en_US.UTF-8”. If you are dealing with non-ASCII characters, you probably want to set the `LC_ALL` environment variable to UTF8, which you can do by setting the Keyboard Maestro variable `ENV_LC_ALL` to “en_US.UTF-8”.
 +
 +By default (v9.0+), if you have not set these environment variables they will be set to UTF-8 for you.
  
 ==== Action Gear ==== ==== Action Gear ====
  
-The Action ​(gear) menu includes the following options:+The action ​(gear) ​⚙ menu includes the following options:
  
 * Trim Results — removes white space from the start and end of the scripts results. * Trim Results — removes white space from the start and end of the scripts results.
action/Execute_a_Shell_Script.txt · Last modified: 2023/09/22 04:39 by peternlewis