Skip to content

Instantly share code, notes, and snippets.

@Raynes
Created December 4, 2011 02:56
Show Gist options
  • Save Raynes/1428975 to your computer and use it in GitHub Desktop.
Save Raynes/1428975 to your computer and use it in GitHub Desktop.
(defun current-itunes-song ()
(do-applescript
"tell application \"iTunes\"
set artist_name to the artist of the current track
set song_title to the name of the current track
set song_album to the album of the current track
set song_length to the time of the current track
set played_count to the played count of the current track
return song_title & \" - \" & artist_name & \" [\" & song_album & \"] [length: \" & song_length & \"] [played: \" & played_count & \"]\"
end tell"))
(defun erc-cmd-NP ()
(erc-cmd-ME (concat " is listening to " (current-itunes-song))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment