I did spend some time over the past weeks debugging the issue. It all comes down to a simple line of AppleScript that as far as I can tell based on the Leopard developer documentation, should work just fine.
The is the line that should work:
set data of front artwork of trk to imageData
To test this, we can try this tiny AppleScript I wrote below. If you want, you can just copy and paste this into a new script file in the AppleScript Editor (don't even need to use Xcode.) This small code sample was modified from an example provided by Doug's AppleScripts for iTunes.
You need to do two things to run this script. Start up iTunes and select a track, any track. If it doesn't have any album art already, that is probably better. You'll also need a .pict format picture file. Not sure if you have one? Here, grab this file.
Then when it asks you to pick a file select your .pict format file.
try
set ourImage to read (choose file) as picture -- must be a pict file
try
tell application "iTunes"
set ourTrack to item 1 of selection -- need a track selected in iTunes before running this
tell ourTrack
set data of artwork 1 to ourImage
end tell
display alert "it worked"
end tell
on error
display alert "Error copying artwork to iTunes." as warning
end try
on error
display alert "Error reading file." as warning
end try
You can also just download that script from my server here.
I foolishly updated all of my computers up to iTunes 7.5 (even the two that I did NOT install Leopard on) and this script will NOT run correctly on any of them. So it appears to be more of an issue with iTunes 7.5 then Leopard.
If anyone who still has an iTunes prior to 7.5 can test this script and let me know that it actually works, I'd love to get that feedback. It's possible I've introduced an error in this script, since I cannot test it myself.
If any developers know why this line of code has stopped working, I'd love to hear that as well.
For now I'll be doing more testing, and posting to the developer forums, etc. to try and resolve this. I may even submit this as a bug to Apple.
8 comments:
thanks for your great software, but I have absolutely now clue how to use your hint to get it working with iTunes 7.5 on Leopard. Perhaps you could write it not that technically ;-)
it's not that hard. just download the script and then press "play" or "voer uit" in dutch. Then search for your pict file. the piano if you download it from here.
so far it works for me then. but in the end i got still an import error :(
Hey,
I still have itunes 7.4.2, but I have Leopard installed. But I still get an error. Just wanted to let you know cause it seems it has something to do with Leopard to not only with itunes 7.5 .
Have a nice day.
Ben
hi, I did also tried the script you post and I still have n error. I found out that if I modify the :
set ourImage to read (choose file) as picture -- must be a pict file
by
set ourImage to read (choose file) from 513 as picture -- must be a pict file
the script will work for every pict files, but not jpeg
I hope this help
I found this : http://forums.ilounge.com/archive/index.php/t-96368.html
you already have a version of iTunes before 7.5. It comes on your tiger install disk, i.e. disk 2, software restore!
Post a Comment