dougscripts.com

March 17 2011 - 12:03 pm

Artwork-Related Scripting Bug Follow-Up

Not long ago I posted about a possible bug introduced with iTunes 10.2 regarding reading PICT file data for use as track artwork (Possible Artwork-Related Scripting Bug in iTunes 10.2?). Essentially, a tried-and-true AppleScript routine for importing PICT image data fails in iTunes 10.2. After some investigation, it turns out that iTunes 10.2 now uses ImageIO for all image handling instead of QuickTime and the ImageIO framework no longer supports PICT files. No one should really be surprised since the PICT format has largely been deprecated. But even so, until recently, PICT was still supported in iTunes.

So it's not a bug but a side effect of modernity.

The fix for iTunes 10.2 and above is to simply read in the data from a PNG or JPEG file:

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

Where theTrack is a reference to a file track in iTunes and targetImageFile is the path to a valid PNG or JPEG image file.

A couple of my scripts that need the fix will be posted later today.

Site contents © 2001 - 2019 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not interrupt the one doing it.