I want to execute a script when iTunes plays a new song. I have looked at Automator as well as the iTunes Library in Script Editor, but don't see anything that will allow me to do this. Any ideas?
You could use an AppleScript to watch for song changes. The script below will get you started:
tell application "System Events" set previousSong to "" repeat if exists process "iTunes" then tell application "iTunes" if player state is playing then set currentSong to name of current track if currentSong is not previousSong then set previousSong to currentSong -- Execute your script, command, or application here say "Song changed" end if end if end tell -- Wait some seconds delay 10 else exit repeat end if end repeat end tell
This AppleScript checks every 10 seconds for the name of the currently playing song. If the song name differs from 10 seconds ago, the phrase "Song changed" is spoken.