iTunes and iPod Script Writing Help

I’ve been searching the web and these forums for quite some time trying to rebuild my script for tagging. I recently had to restore my SSD and lost my tagging script. Now, I am trying to write a new one that is optimized for use with iTunes and more importantly my iPod video. My OS is OSX Sierra. Any and all help is appreciated!

The problems:

The iPod does not sort by album artist. Currently, I have all of my songs “Artist” field sorted like “Artist feat. Artist Name, Artist Name…”. This is problematic on the iPod because it makes albums get separated, and there to be a bazzilion artists under music>artists.

^^This is my number one priority in solving^^

I need help organizing all artist fields firstname, lastname instead of lastname, firstname

What I am hoping to accomplish (using Guilty by Al Green from the album The Immortal Soul of Al Green):

Title: Guilty

Artist: Al Green

Album: The Immortal Soul of Al Green

Track Number: 2

Length: 2:58

Date: 2003

Album Artist: Al Green feat. The Soul Mates

Album Artist Sort: Al Green

Artist: Al Green

Artist Sort: Al Green

Total Discs: 4

Total Tracks: 24

My thought on switching the featuring from artist to albumartist is to make it more organized on the iPod, and I will just live with artist and albumartist being switched in iTunes.

Please help! I really do appreciate the help and am open to any suggestions. Thanks!

I would also not be opposed to just using another user’s taggerscript if it meets the above criteria. If it would save someone time to just copy and paste I wouldn’t mind a few tweaks thrown in.

I’m guessing you’re using one of the “extract featured artists from title” plugins? Since I’m not and the album in MB hasn’t been fixed (I’m getting right on that after posting this), I’m not entirely sure how they’ll interact, but as long as whatever you’re using to put the “feat. The Soul Mates” in the (original) Artist field runs before Picard applies the scripts, this should work just fine. If you aren’t and are hoping the script will do that for you, that’s admittedly theoretically possible, but I’m not going to spend the time putting it together when there’s a couple presumably-perfectly-functional plugins right in the database, not to mention my typical solution of “do it manually”. I am, however, completely happy to make any tweaks to this one, or fill in any other fields you need.

$noop(Copy the non-sort artist names over the sort fields)
$noop(While we're at it, may as well swap the fields for the iPod)
$set(albumartistsort, %artist%)
$set(artistsort, %albumartist%)

$noop(Copy the swapped sort fields back into the primary ones)
$set(artist, %artistsort%)
$set(albumartist, %albumartistsort%)

I am a bit worried about what this might do to your iTunes display, though. Since I last used it about six years ago I don’t know how it categorizes albums, but the programs I do use tend to treat Album Artist about like it sounds your iPod does, and if I tried to apply this to my library, I’d wind up with the same fractured albums you’re trying to fix. If iTunes doesn’t have that problem (or if you can fix it through the options menu), then great! Otherwise, I’d think about just sticking the extended artists in the Sort Artist, and see if there’s a way to display custom columns in iTunes:

$noop(Copy the non-sort artist names over the sort fields)
$set(artistsort, %artist%)
$set(albumartistsort, %albumartist%)

$noop(Fix the iTunes display)
$set(artist, %albumartist%)
1 Like

Thanks for the detailed reply, everything looks good so far.

Would anyone be able to add the sort by feature to move “The” to the end? Ex. Wallflowers, The

That is a bug I missed in my original script. Sorry! I should ask, though, do you just want that for the artist, or do you want the album/track title as well? If you mean the former, that’s already handled by the MusicBrainz sort fields (or if it isn’t, the name in the database needs to be updated) and unless you don’t also want “Lastname, Firstname” for traditional, human names, that can be solved by simply not using the sort names as the staging point:

$noop(Swap the fields for the iPod)
$set(_albumartisttemp, %artist%)
$set(_artisttemp, %albumartist%)
$set(_albumartistsorttemp, %artistsort%)
$set(_artistsorttemp, %albumartistsort%)

$noop(Copy the temporary fields back into the primary ones)
$set(artist, %_artisttemp%)
$set(albumartist, %_albumartisttemp%)
$set(artistsort, %_artistsorttemp%)
$set(albumartistsort, %_albumartistsorttemp%)

$noop(Clean up after ourselves)

If you only want the group names to be sorted without “A” or “The” (and have people sorted under their first name), that’s a bit more difficult because of the multi-value tags, but could probably still be done. I’d rather not put in the time figuring out how to do that if it’s not going to be necessary, though, so if that is what you want, let me know and I’ll get digging.

For the titles, I’m actually using the next script in my own library. It will still run into issues with multiple values, but given that, most of the time, those fields should only have a single value (and most players wouldn’t know what to do if there were multiple), that shouldn’t be anywhere near the problem it is with the artists.

1 Like

Ahh now those scripts accomplish exactly what I wanted. I would not have been able to figure that out on my own in any timely manner. Now I can get back to actually listening to my music and not fixing all the metadata. Thanks again!