What is Osascript?

Learning about Osascript started with me wanting to be able to control the play button of Spotify without having to leave my Terminal. I ended up going down a rabbit hole of what’s possible with quality-of-life scripts that you can write on your computer, so I’ll keep it brief and surface level. Here’s a definition from the SS64 website:

“Execute AppleScripts and other OSA language scripts. Executes the given script file, or standard input if none is given. Scripts can be plain text or compiled scripts. Osascript was designed for use with AppleScript, but will work with any Open Scripting Architecture (OSA) language.”

One quick note: if you are seeing a popup on your computer that’s telling you that osascript needs control of your computer, it’s definitely malware and you definitely shouldn’t click accept.

It basically just runs a script from your terminal that you’ve either compiled or typed out with plain text. Compiling a script and simply calling it from your Terminal is definitely what you should be doing, since it’ll allow you to have more functionality, but sometimes laziness takes over. I have a few examples of other commands listed below:

Sourced from: osascript

If you wanted you could also save these as alias shortcuts in your zsh or bash profile. Checkout my first blog post for instructions and give it 50 claps please.

For a fully click free Spotify experience follow these steps:

Source:

https://ss64.com/osx/osascript.html

--

--

--

Full Stack Developer | React | JavaScript | Ruby on Rails

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Angular 5 — bootstrapping (using angular-cli)

Implement AdMob in React Native with Firebase

Implement AdMob in React Native with Firebase

Getting Started with the Blazor Spinner Component

Implement a ReCaptcha React component validated by Symfony

Basics of React.Js

My Favorite Programming Quotes

DDD with various programming languages in my way: part1 typescript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Victor Scholz

Victor Scholz

Full Stack Developer | React | JavaScript | Ruby on Rails

More from Medium

Solitude, silence, and flowing rivers.

Two Stories | Career Transitions

Unlocking Literacy Mindsets: Trapped by Trying to Control the Outcomes

ERCOT or not? Power or not?