Has anyone ever setup an action/script in Mp3tag to import the "Sort Album" and "Sort Artist" fields from the iTunes Library xml catalog file into the ALBUMSORT and ARTISTSORT tags in the actual MP3 file (if they are blank in the file)?
My issue is that I would like my iTunes library to be portable in case I ever stop using iTunes. However, many fields (including the sort ones) are stored in the catalog/library file instead of the file itself, and I want to preserve that data. Most of my files actually already have that, since I set that info before importing the tracks into iTunes. However, I have a lot of old ones out there that were added to iTunes before I started doing that, so those tags are blank and I would like to set them.
The xml file has the filename in it (as well as the track #, song title etc), so I'm thinking there should be a way to extract the necessary fields in the xml to a text file that I can import using Mp3tag, but I've never really tried anything like that before.
One warning beforehand. The program you could try hasn't been updated for a long time, however I still use it on my iTunes Library (12.3.1.*) and it still seems to work.
I think the only way is to use the iTunes function "Convert Tag" (or whatever that is called). Use that for every file and iTunes will write the database information into the tags.
Hmm, that didn't work either. I did what was suggested in the thread (converted the tags first to "None" and then to "v2.3") and I still don't get those sort fields moved to the tags. I did lose the embedded artwork (and other things) as mentioned would happen.
Maybe there's just something about my configuration. I'm running iTunes 12.3.1.23 under Windows 10.
I am sorry to hear that. Losing data is always bad, that is my opinion.
Now: perhaps, going the other way with MP3tag being the master tagger and iTunes the program to read the tags, simple actions could solve the problems
E.g.: filter the files with a "The" in Front" copy the contents to ARTISTSORT and then move the "The" to the end:
Action "Format value" for ARTISTSORT
Format String: %artist%
Next:
Action "Replace with regular expression" for (e.g.) ARTISTSORT:
Search string: The (.*)
Replace string: $1, The
I only tried it on one album, and I saved a copy of it first, so I was good. Plus my entire iTunes library is backed up on a second drive.
That doesn't really help me. The issue is that I have my specific sorting system for artists and albums in iTunes that can't really be derived from other tags. So I really need to be able to copy exactly the fields that are in the iTunes library.
I may end up just having to fix them each one by one...
I do not know what is wrong with your files. Because I just tested it with an MP3 and IDV2.3:
I selected a file in iTunes,
opened the "Information" dialogue,
switched to tab "Sorting"
entered
Artist for sorting: Beatles, The
Artist: The Beatles
Clicked OK
Checked the file in MP3tag - and voilà: the field ARTISTSORT showed "Beatles, the".
So perhaps you have a different problem like APE tags in the files or something else that hides the already existing information in MP3tag.
That works for me, but I have to actually change the fields in iTunes before it will write them to the MP3. So since the iTunes library fields are already set to what I want, I have to set them to something else first (which writes the new value to the MP3), and then back to the correct value (which writes to the MP3). I wish I could just choose "Get Info" on the affected tracks, hit "ok" without changing anything, and then it would rewrite all the tags, but that doesn't work. Or even if I could change some other global album value (something I never use like "grouping") and then hit Ok, but that again doesn't affect the fields I didn't change.