Skip to content

Instantly share code, notes, and snippets.

@samdmarshall
Created December 17, 2012 20:59
Show Gist options
  • Select an option

  • Save samdmarshall/4322180 to your computer and use it in GitHub Desktop.

Select an option

Save samdmarshall/4322180 to your computer and use it in GitHub Desktop.
# iTunes
if isRunning("iTunes") then
tell application "iTunes"
if player state is playing then
set my_message to do shell script "RANGE=11; number=$RANDOM ; let \"number %= $RANGE\" ; echo `sed -n \"$number\"p ~/Documents/wordlist.txt`"
set nowPlaying to "/me is " & my_message & artist of current track & " - " & name of current track
end if
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment