Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
(defn itunes [command]
(let [mgr (javax.script.ScriptEngineManager.)
engine (.getEngineByName mgr "AppleScript")]
(.eval engine (str "tell application \"iTunes\" to " command))))
(itunes 'pause)
(itunes 'play)
(itunes 'stop)
;; ...

fogus commented Sep 20, 2010

I found this on on the Internets many months ago, but have lost the attribution. If you know who created this originally please let me know.

qerub commented Apr 21, 2013

The AppleScriptEngine has been removed in OS X 10.8, but can be restored from 10.7:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment