Customizing iTunes scripts: Creating 'iTunesArtistList' and auto-applying 'CDN' grouping

1) Would it be possible to customize "iTunesAlbumList" script into "iTunesArtistList"?


I was hoping to be able to select a Smartplaylist from my library, then make a list of all the different artist's, without multiple instances of identical artists.


2) The other dream script is slightly more complex. For my music library, I've been using CDN in the Grouping field to designate Canadian bands/artists, while using "KeywordsToGrouping". I've gone through my entire library, and have applied this to every instance that I am aware of, which now allows me to have a Smartplaylist based on "CDN".


For future proofing, would there be any possible way to scan new additions to my library, and auto apply "CDN" into the grouping field for songs where an artist has already been designated as "CDN"?


This would massively help for whenever I add compilation albums to library, where I might not always notice that a niche artist qualifies for CDN grouping.


For my library, I keep my Artist fields as basic as possible. So for example, all songs by "Drake" are listed as "Drake" in the artist field, where extra info (Such as Featuring) is kept in Title field after song name.


Call me old fashioned, but I am not a fan of having multiple instances of the same artist in the artist field.



[Re-Titled by Moderator]

Original Title: Customizing iTunes scripts



Posted on Nov 16, 2025 8:13 AM

Reply
4 replies

Nov 17, 2025 12:51 PM in response to SamIRDavies

Hi there,


I've made a quick edit to the original script to create iTunesArtistList which I am hoping will do what you want. All distinct values of artist and album artist are gathered, sorted, and exported.


There really isn't an obvious way to fulfil the second request short of writing a dedicated script that would cycle through all tracks noting those artists (only, not album artists I suspect) currently with a grouping of CDN, and then processing all tracks again where the artist has been noted on the first pass and adding the CDN grouping if not attached to that track. The script I've just created could serve as a starting point, with the second pass updating Grouping where needed instead of writing any data out to a file. Do you think that would work for you?


tt2

Nov 19, 2025 1:47 PM in response to SamIRDavies

SamIRDavies wrote:

I just tested the script, and it seems to be processing my entire library, and not the selected songs (4 in total, for testing purposes). Is there any way to get it to be based on selected files/playlist?


Ah yes, apologies for that. Most of my scripts are designed to work with the current selection or playlist, falling back to the whole library when nothing is selected and you aren't inside a playlist. Looking at the original request that resulted in iTunesAlbumList it seems clear they wanted to list all of the albums in their library so that is what I did. I can rewrite iTunesArtistList for you so that it works on a selection instead.


Your suggestion for CDN seems reasonable. Ideally, I would select all the songs with CDN in the GROUPING field, so that my entire library does not need to be scanned for names in ARTIST field. Whenever I add new music, I would select all the new content, and run a script to see if there are identical matches to what was found in the previous ARTIST scan.


Again, I'll look at writing the new script so that it works with a section or the current playlist from the outset. Getting the script to have an external memory file is a little more tricky, but I will have a think about it.


tt2

Nov 19, 2025 12:53 PM in response to turingtest2

I just tested the script, and it seems to be processing my entire library, and not the selected songs (4 in total, for testing purposes). Is there any way to get it to be based on selected files/playlist?


Your suggestion for CDN seems reasonable. Ideally, I would select all the songs with CDN in the GROUPING field, so that my entire library does not need to be scanned for names in ARTIST field. Whenever I add new music, I would select all the new content, and run a script to see if there are identical matches to what was found in the previous ARTIST scan.

Nov 19, 2025 3:18 PM in response to turingtest2

Many thanks. As always, a deep appreciation for your efforts.


For years now, whenever I add to my library, I regularly use 4 of your scripts.

KeywordsToGrouping, KeywordsToDescription, TitleCase, and a custom version of CustomRenamer you made for me called CustomNameOnly which allows me to rename my files when TITLE tag has been modified.

Tremendously useful.


While I am not fluent in scripting, I have been making exception additions to TitleCase , which has also been really useful.

Customizing iTunes scripts: Creating 'iTunesArtistList' and auto-applying 'CDN' grouping

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.