Anyone know a reliable way of setting the artwork for a song in iTunes through AppleScript? Here's how I GET the artwork through iTunes:
But when I try to do the analogous setting of the artwork through AppleScript like this:
... all that happens is iTunes crashes and I get a "connection not valid" error or a "parameter error" (last night I got the connection error, but today I ran the same script and got a parameter error -- I swear I didn't change anything). Can anyone tell me how to modify my script so that it works? Any help at all would be greatly appreciated.
(Just in case it matters, I'm using iTunes 4.8 on Mac OS X 10.4 Tiger.)
Code:
tell application "iTunes"
set the_artwork to data of artwork 1 of current track
end tell
But when I try to do the analogous setting of the artwork through AppleScript like this:
Code:
tell application "iTunes"
set the_artwork to read POSIX file "/UNIX/PATH/TO/FILE" as picture
set data of artwork 1 of current track to the_artwork
end tell
... all that happens is iTunes crashes and I get a "connection not valid" error or a "parameter error" (last night I got the connection error, but today I ran the same script and got a parameter error -- I swear I didn't change anything). Can anyone tell me how to modify my script so that it works? Any help at all would be greatly appreciated.
(Just in case it matters, I'm using iTunes 4.8 on Mac OS X 10.4 Tiger.)