Set iChat status message and icon to iTunes song

Jul 12, '04 07:30:04AM

Contributed by: Edison517

I use iChatStatus and a custom/modified script to automatically change my iChat status to the current track playing in iTunes and display the cover of the album (if there is one). If there's no icon, it displays a picture of myself I have on the computer. Also, if iTunes is open but isn't playing a song, it clears the status message and puts my icon to my photo. Pretty cool little script. As a side note, you may need GraphicsImporter (giconvert) to convert the CD covers to ichat icons. Feel free to modify as desired to work for your individual tastes. Enjoy!

tell application "iTunes"
  if player state = playing then
    set theartist to artist of current track
    set thesong to name of current track
    if exists artworks of current track then
      set theData to data of (artwork 1 of current track)
      set theTiff to giconvert theData type "TIFF" resolution {32, 32}
    else
      set r to open for access file "Willis:Library:Webserver:Documents:me.jpg"
      set theTiff to read r as TIFF picture
    end if
    tell application "iChat"
      set status message to "iTunes:" & theartist & " - " & thesong
      set image to theTiff
    end tell
  else
    set r to open for access file "Willis:Library:Webserver:Documents:me.jpg"
    set theTiff to read r as TIFF picture
    tell application "iChat"
      set image to theTiff
      set status message to ""
    end tell
  end if
end tell
[robg adds: I haven't tested this one...]

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040708200423197