The latest version of my artwork grabbing script for GrowlTunes. This applescript - which is basically a replacement for jackItunesArtwork.scpt - takes the artwork from iTunes, and uses that to set the buddy icon in Adium. If you don't have any artwork associated with your music, then it will just use your default icon in Adium.
I've actually been able to remove a lot of the ugly hacks I had to put in for supporting shared artwork since iTunes has finally made shared tracks first class applescript citizens, meaning that you can use the same method for retrieving shared and embedded artwork in tracks.
on setbuddyiconsconvertingdata(imagedata) set temppath to path to temporary items as string set openfileid to open for access file (temppath & "cover.jpg") with write permission write imagedata to openfileid close access openfileid setbuddyicons(temppath & "cover.jpg") end setbuddyiconsconvertingdata on setdefaultbuddyicon() tell application "System Events" if (exists process "Adium") then tell application "Adium" set defaultimage to default image end tell my setbuddyiconswithdata(defaultimage) end if end tell return end setdefaultbuddyicon on setbuddyiconswithdata(imagedata) tell application "System Events" if (exists process "Adium") then tell application "Adium" repeat with acc in accounts try set image of acc to imagedata on error the error_message number the error_number set the error_text to "Error: " & the error_number & ". " & the error_message end try end repeat end tell end if end tell return end setbuddyiconswithdata on setbuddyicons(buddypath) set fileid to open for access file buddypath set tiffimagedata to read fileid as TIFF picture close access fileid setbuddyiconswithdata(tiffimagedata) return end setbuddyicons on getlocalartwork() tell application "iTunes" set currlocation to the location of current track as string set directory to change ":[^:]*\\.m[p43a]{2}$" in currlocation into "" with regexp set coverpath to directory & ":cover.jpg" end tell set temppath to path to temporary items as string try tell application "Image Events" launch set myimage to open coverpath save myimage as JPEG in temppath & "cover.jpg" close myimage saving no set myimage to open temppath & "cover.jpg" scale myimage to size 300 save myimage as PICT in temppath & "cover.img" close myimage saving no end tell on error the error_message number the error_number return null end try set fileid to open for access file (temppath & "cover.img") set theimagedata to read fileid as picture close access fileid return theimagedata end getlocalartwork try tell application "iTunes" set returnValue to "fsck" set aLibrary to name of current playlist set aTrack to current track set aTrackArtwork to null if ((count of artwork of aTrack) ≥ 1) then set aTrackArtwork to data of artwork 1 of aTrack else if not (class of aTrack is shared track) then set aTrackArtwork to my getlocalartwork() end if if (aTrackArtwork = null) then my setdefaultbuddyicon() else my setbuddyiconsconvertingdata(aTrackArtwork) end if set returnValue to {aTrackArtwork, aLibrary} end tell on error the error_message number the error_number set returnValue to "fsck" end try return returnValue