Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Accessing iTunes 4 cover art via AppleScript

Accessing iTunes 4 cover art via AppleScript
Thread Tools
eno
Banned
Join Date: Sep 2000
Location: Fightclub
Status: Offline
Reply With Quote
Apr 29, 2003, 12:59 AM
 
Anyone figured out how to do it yet?
     
bewebste
Senior User
Join Date: Mar 2000
Location: Ithaca, NY
Status: Offline
Reply With Quote
Apr 30, 2003, 06:22 PM
 
I think this has been determined to be impossible. There is an entry in the dictionary for a class called "artwork" which contains information about a given artwork, but there is no corresponding property on the track class to allow access to the data.
     
RevEvs
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status: Offline
Reply With Quote
Apr 30, 2003, 07:04 PM
 
yeah i was messing around with it, is there any way to set the artwork through applescript? if there is a way to get applescript to set a tiff/jpg as artwork for a specified song then automating it to get album covers would be a hell of a lot easier!

revs
I free'd my mind... now it won't come back.
     
RevEvs
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status: Offline
Reply With Quote
Apr 30, 2003, 07:05 PM
 
BTW, would be enternaly grateful to anyone that make a little app that will automatically get all the album covers

revs
I free'd my mind... now it won't come back.
     
eno  (op)
Banned
Join Date: Sep 2000
Location: Fightclub
Status: Offline
Reply With Quote
May 1, 2003, 04:05 AM
 
Originally posted by RevEvs:
BTW, would be enternaly grateful to anyone that make a little app that will automatically get all the album covers

revs
Synergy doesn't do a bad job of it. Plus it has some other great features. Works really well with iTunes 4, but I'm hoping the author can release something that will answer this question (I don't want to have to drag all of my covers in by hand; if I could find out how to do it with AppleScript then I could automate the process and use all the covers that Synergy has already downloaded for me!).
     
RevEvs
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status: Offline
Reply With Quote
May 1, 2003, 06:24 AM
 
yeah i have synergy. but it is stilla pain to drag al these in by hand.

revs
I free'd my mind... now it won't come back.
     
bluehz
Dedicated MacNNer
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 1, 2003, 08:02 AM
 
There is a perl module MP3::Info that I am playing with - seems to access cover art. I have managed to extract the art, but not input art to an MP3 file yet. Haven't spent a lot of time on it yet though. Also - this would only apply to MP3's anyway - I suspect, so AAC is a whole other beast.
     
joltguy
Mac Enthusiast
Join Date: May 2001
Location: 127.0.0.1
Status: Offline
Reply With Quote
May 2, 2003, 10:01 AM
 
I wonder if the new AppleScript GUI Scripting technology might be able to help with this task. I'm only a dabbler when it comes to AppleScript, but it seems like you may be able to have AppleScript tell iTunes to "Show Info" for a selected track, click on the "Artwork" tab, and paste an image (also fetched via AppleScript) into the provided area. It would probably be quite slow, but hey, at least it'd be fully automated.

Any scripters out there think this might be a workable approach?
     
bluehz
Dedicated MacNNer
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 2, 2003, 09:24 PM
 
I used to be really big on Applescript. Never a real programmer - but I dabbled and could hobble together little apps to suit my needs. Then I started messing with the Unix side of OS X - namely shell scripts, and after I wrote my first shell script it was all over for AS... the speed difference is no comparison. Now I have never programmed anything in my life, until I started messing around by myself on a Mac. Now I am teaching myself some perl, and its even more cool than shell scripting.

Also - I always looked at shell/perl scripts and thought "man that looks complicated" when actually I find out after using shell/perl scripts a bit - I can actually understand their language better than I ever did Applescript. Sure Applescript is user friendly, but I think sometimes that may be a detriment to it.

Long story short ... take a look at perl and shell scripting.....
     
Tesseract
Grizzled Veteran
Join Date: Apr 2002
Location: california
Status: Offline
Reply With Quote
May 3, 2003, 07:34 AM
 
     
[email protected]
Fresh-Faced Recruit
Join Date: May 2003
Status: Offline
Reply With Quote
May 4, 2003, 09:41 PM
 
tell application "iTunes"
data of artwork 1 of current track
end tell

seems to work ok, though I've had it crash the calling application a handful of times with certain images.
     
aladdinsane
Forum Regular
Join Date: May 2001
Location: Mnt View, CA
Status: Offline
Reply With Quote
May 8, 2003, 03:03 AM
 
Here is a little variation to Paul's script (great first post btw).

Here is a script that copies artwork of current song to the clipboard.

Code:
tell application "iTunes" set the clipboard to (data of artwork 1 of current track) as picture end tell
And the other way, paste what you have on the clipboard to current song.

Code:
tell application "iTunes" set (data of artwork 1 of current track) to the clipboard as picture end tell
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:07 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,