This is a simple "now playing" announcer for Textual (http://www.codeux.com/textual/) that pulls the information from Spotify, iTunes, and QuickTime (whichever you're using at the time)
Save the code as np.scpt and place it in ~/Library/Application Support/Textual/Scripts
To run the script, type /np in a channel or query window.
on textualcmd()
set nowPlaying to "I'm not currently playing anything."
# Spotify
if isRunning("Spotify") then
tell application "Spotify"
if player state is playing then set nowPlaying to "Spotify: " & artist of current track & " - " & name of current track & " (" & album of current track & ")"
end tell
end if
# iTunes
if isRunning("iTunes") then
tell application "iTunes"
if player state is playing then set nowPlaying to "iTunes: " & artist of current track & " - " & name of current track & " (" & album of current track & ")"
end tell
end if
# QuickTime Player
if isRunning("QuickTime Player") then
tell application "QuickTime Player"
if playing of document 1 then set nowPlaying to "QuickTime: \"" & name of document 1 & "\""
end tell
end if
return nowPlaying
end textualcmd
on isRunning(mediaPlayer)
tell application "System Events"
tell application "System Events" to return exists (processes where name is mediaPlayer)
end tell
end isRunning