Q: Fetch album artwork with AppleScript
Goodness gracious, there are more properties for a track in the iTunes .sdef than I could ever imagine. However, one that is notably absent is the album artwork. Since this is not directly a property, is there some other way I can retrieve a track's album artwork?
Posted on Sep 12, 2016 10:43 AM
Artwork is an element of a track, not a property. Tracks can have multiple pieces of artwork, each of which has its own set of properties.
It's pretty trivial to obtain, though:
tell application "iTunes"
set myArtwork to every artwork of track 1 of playlist "Music"
end tell
Once you have that, you can parse the data however you want. For example, to extract the JPEG image, you can:
tell application "iTunes"
set myArtwork to first artwork of track 1 of playlist "Music"
if format of myArtwork is JPEG picture then set myPicture to data of myArtwork
end tell
Posted on Sep 12, 2016 11:03 AM