Skip to content

Instantly share code, notes, and snippets.

@fogus
Created September 20, 2010 12:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save fogus/587812 to your computer and use it in GitHub Desktop.
Save fogus/587812 to your computer and use it in GitHub Desktop.
(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)
;; ...
@qerub
Copy link

qerub commented Apr 21, 2013

The AppleScriptEngine has been removed in OS X 10.8, but can be restored from 10.7: http://stackoverflow.com/a/12188389/339785

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