Skip to content

Instantly share code, notes, and snippets.

@CarlQLange
Created December 29, 2011 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CarlQLange/1532172 to your computer and use it in GitHub Desktop.
Save CarlQLange/1532172 to your computer and use it in GitHub Desktop.
Line 2 below breaks, because of the single-quote in the song title. Bash is sucky and doesn't allow
backslash escaping for that, and doing the '"'"' solution (as documented here
http://stackoverflow.com/questions/1250079/bash-escaping-single-quotes-inside-of-single-quoted-strings)
doesn't work because it's already in an applescript string. Best would be a general solution.
osascript -e 'tell application "iTunes"
play track "Rory's First Kiss (Ryeland Allison remix)"
end tell"'
@tkazec
Copy link

tkazec commented Dec 29, 2011

Funnily enough, I was actually looking at something similar a few minutes ago: https://github.com/tkazec/omfgupgrade/blob/master/build.sh

osascript - <<EOF
tell application "iTunes"
    play track "We're back!"
end tell
EOF

@CarlQLange
Copy link
Author

YESSS

Thank you!

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