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 > Applications > AppleScript & .mp3 tags

AppleScript & .mp3 tags
Thread Tools
doubtingtom
Fresh-Faced Recruit
Join Date: Oct 2003
Location: Japan
Status: Offline
Reply With Quote
Feb 3, 2004, 06:57 PM
 
So, I have a bunch of single songs back from my days of stealing music (I've been clean since the iTMS launch - and I mostly buy albums now).

Most of these songs have album names. I want to batch process them and change all the albums to "Singles" because my library is too cluttered with albums that aren't really albums, and it is hard to just the singles.

But here is the catch, I want the album field to be copied to the comments field so I don't lose the information.

Could I use AppleScript with iTunes to do this? Does anyone know how? Or would it be better to pay for something like mp3 Rage Pro and script that (can it be scripted). I would like to get into scripting, but I am having a hard time getting started.

Thanks
12 Powerbook rev. B
17 LCD
     
Moonray
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 3, 2004, 09:11 PM
 
Here you go:
Code:
tell application "iTunes" activate try set these_tracks to the selection of browser window 1 if these_tracks is {} then error "You need to select one or more tracks first." set the original_setting to fixed indexing set fixed indexing to true repeat with this_track in these_tracks set comment of this_track to "(Album was '" & album of this_track & "')" & comment of this_track set album of this_track to "Single" end repeat set the fixed indexing to the original_setting on error e number n if the n is not -128 then display dialog e buttons {"Cancel"} default button 1 end if end try end tell
Enter this in the script editor and save the script in ~/Library/iTunes/Scripts. Then select your "single" tracks and start the script from the menu (try with only one track the first time ).

-
     
doubtingtom  (op)
Fresh-Faced Recruit
Join Date: Oct 2003
Location: Japan
Status: Offline
Reply With Quote
Feb 4, 2004, 10:27 PM
 
Thanks for the script, however, is there a way for the computer/applescript to select all the singles. Or maybe easier would be to hmake a playlist by checking if an artist has less than three songs. I tried doing that with a smart playlist, but couldn't. It isn't that I am lazy, but 1, my music collection is 40 gigs so that is a lot of hunting and selecting and 2, I'm trying to get into AppleScript, as I think it would be a powerful tool to learn.

Thanks,
12 Powerbook rev. B
17 LCD
     
Moonray
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 4, 2004, 11:34 PM
 
Yes, you can do that with Applescript.
  1. Make a list of all artists
  2. Remove duplicates from that list
  3. Go through that list and look for every track whose artist is that artist
  4. Depending on the number of tracks found change the album

-
     
   
Thread Tools
 
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 05:51 AM.
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.,