iTunes, AppleScript & Album Art

With AppleScript you can write cool automation tasks such as importing album art. Before iTunes 10.2 you had to manipulate the image as a PICT file in order for the script to execute properly. With the recent release of iTunes 10.2 this functionality broke... for the better. The fix is rather simple. All you need to do is read the data from a PNG or JPEG file! Below is how it works.

tell application "iTunes" to set data of artwork 1 of theTrack to (read (file targetImageFile) as picture)