Hello applescript experts/enthusiasts-
I am trying to insert additional album artwork into a given track in iTunes. I have been successful at getting one piece of artwork into a track (see http://bbs.applescript.net/viewtopic.php?t=10586&highlight=artwork). However, when I do the following ,
set pathToImage to ":path:to:image"
tell application "iTunes"
set currentArtwork to (read file pathToImage from 513 as artwork)
set artwork 2 of current track to currentArtwork
end tell
I get a ‘parameter error’. If there is already artwork in position 2, it works fine. Therefore, I think that the solution must have something to do with creating new artwork and inserting it into the iTunes track. However, I have not yet figured out how to do this.
Does anyone have any thoughts or comments on how to accomplish this?
My script was tested on Mac OS X 10.3.9 and iTunes 4.7.1 (30). iTunes had some trouble with “current track” unless the current track was actually playing. Not sure why that is. Anyway, the code I posted above worked for adding new artwork to a track regardless of what was already there (0, 1, or more artworks). Are you using a PICT file or some other file as the artwork? This only worked for me when using PICTs (and, indeed, the code you reference for reading from byte 513 on is meant to strip the header from PICT files, not other types of image files).
I’ve noticed that the read from 513 doesn’t work with iTunes 4.8 in Tiger. I’ll get a transparent background, which renders as black in the artwork pane. Anyone have any suggestions?