Is anybody interested in how to write a script for automatically generating a sort order tag from an artist tag? I have written a script to do it, part of which I'll reproduce below. (It is too bad that you can't export scripts from Mp3Tag.)
- Merge duplicate fields "ARTIST": ";"
- Format value "TVSEASON": %artist%
- Format value "TVEPISODE": $If($grtr($strchr(%tvseason%,';'),0),$trim($left(%tvseason%,$strchr(%tvseason%,';')),';'),%tvseason%)
- Format value "TVEPISODE": $right(%tvepisode%,$sub($len(%tvepisode%),$strrchr(%tvepisode%,' '))), $trim($left(%tvepisode%,$strrchr(%tvepisode%,' ')))
- Format value "TVEPISODE": $If($eql($len(%tvseason%),0),,%tvepisode%)
- Format value "ARTISTSORTORDER": $If($grtr($len(%tvepisode%),0),%tvepisode%,%artistsortorder%)
- Format value "TVSEASON": $If($grtr($strchr(%tvseason%,';'),0),$right(%tvseason%,$sub($len(%tvseason%),$strchr(%tvseason%,';'))),)
- Format value "TVEPISODE": $If($grtr($strchr(%tvseason%,';'),0),$trim($left(%tvseason%,$strchr(%tvseason%,';')),';'),%tvseason%)
- Format value "TVEPISODE": $right(%tvepisode%,$sub($len(%tvepisode%),$strrchr(%tvepisode%,' '))), $trim($left(%tvepisode%,$strrchr(%tvepisode%,' ')))
- Format value "TVEPISODE": $If($eql($len(%tvseason%),0),,%tvepisode%)
11.Format value "ARTISTSORTORDER": $If($grtr($len(%tvepisode%),0),%artistsortorder%;%tvepisode%,%artistsortorder%) - Remove fields "TVEPISODE;TVSEASON"
This program assumes that if more than one artist appears in the Artist tag, they are separated by ';'. The first line is needed only if you have multiple Artist tags. TVSEASON and TVEPISODE are used to store values, on the assumption that we're dealing with music files that won't already have these tags in use. (Any empty fields would do. I don't know how else to store values.)
The program will will do up to two artists, which it separates with ';'. It converts First Last order to Last, First. If you want to be able to do more artists, iterate lines 7-11. My own version does five iterations, which should be enough. If there's a way to conditionally halt programs, I'm unaware of it. (That could easily be! Today is my first attempt to write any scripts for Mp3Tag.)
The program is no doubt inelegant, but I think it is correct. I hope it may help others who want to automate this job.