property theLogFile : POSIX path of ((path to current user folder as Unicode text) & "Library:Application Support:Tremulous:base:configs:song.cfg") global lastTrack on run set lastTrack to missing value tell application "System Events" to launch idle end run on idle tell application "System Events" to get name of every process if "iTunes" is in result then try tell application "iTunes" to tell current track set currentTrack to database ID if currentTrack is not equal to lastTrack then set lastTrack to currentTrack get artist & " - " & name try do shell script "echo /me ^2is listening to ^5" & quoted form of result & " > " & quoted form of theLogFile on error errorMsg number errorNum display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "OK" default button 1 with icon caution end try end if end tell end try end if return 30 end idle