From 2a1eec818dab54456fe96ff9277cc917881c98ef Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sun, 17 Feb 2019 11:21:38 -0600 Subject: [PATCH] Add Run AppleScript Commands Inline In The Terminal as a Mac til --- README.md | 3 ++- ...pplescript-commands-inline-in-the-terminal.md | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 mac/run-applescript-commands-inline-in-the-terminal.md diff --git a/README.md b/README.md index 3afce7a..a363497 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_766 TILs and counting..._ +_767 TILs and counting..._ --- @@ -328,6 +328,7 @@ _766 TILs and counting..._ - [Require Additional JS Libraries In Postman](mac/require-additional-js-libraries-in-postman.md) - [Resizing Both Corners Of A Window](mac/resizing-both-corners-of-a-window.md) - [Run A Hardware Check](mac/run-a-hardware-check.md) +- [Run AppleScript Commands Inline In The Terminal](mac/run-applescript-commands-inline-in-the-terminal.md) - [Set A Window To Its Default Zoom Level](mac/set-a-window-to-its-default-zoom-level.md) - [View All Windows Of The Current App](mac/view-all-windows-of-the-current-app.md) diff --git a/mac/run-applescript-commands-inline-in-the-terminal.md b/mac/run-applescript-commands-inline-in-the-terminal.md new file mode 100644 index 0000000..0a167e2 --- /dev/null +++ b/mac/run-applescript-commands-inline-in-the-terminal.md @@ -0,0 +1,16 @@ +# Run AppleScript Commands Inline In The Terminal + +[AppleScript](https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html) +is often invoked as a series of commands from a file. It is also possible to +execute individual commands inline in the terminal. Use the `-e` flag to +specify the command. + +For example, if you'd like to mute your Mac: + +```bash +$ osascript -e 'set volume 0' +``` + +Run that and your Mac's volume will now be at zero. + +[source](http://osxdaily.com/2016/08/19/run-applescript-command-line-macos-osascript/)