Request: Script for Dynamic Genre Tagging

Hi mp3tag scripting experts,

I'm looking for assistance in automating my genre tagging workflow. I've been manually assigning genres to my music files, but I'd like to streamline this process using a script.

Here's my situation:

I have a data source (which I can format as a CSV or text file) that contains a lookup table of artists and their corresponding genre information. The format of this data is:

Artist;Genre;Subgenre;Decade

For example:

ABBA;Pop;Disco-Pop;70s AC/DC;Hard Rock;Blues Rock;70s Adele;Pop;Soul;2000s

I want to create an mp3tag script that does the following:

  1. For each file being processed, the script should read the "Artist" tag.
  2. The script should then search the lookup table for a matching artist.
  3. If a match is found, the script should write the "Genre;Subgenre;Decade" string into the Genre tag of the file.

Essentially, I want to automate the process of taking the Genre, Subgenre, and Decade information from my lookup table and applying it to the Genre tag based on the Artist tag.

Could someone provide guidance or a script example on how to achieve this in mp3tag? I'm comfortable with basic scripting concepts but need help with the specific syntax and functions within mp3tag. TIA!

The only place where I see a way to compare data of different fields would be as part of functions that allow a format string.
And that is basically an action of the type "Format value", in this case for GENRE.
You would have to create an action group that contains an action for each artist from your lookup table and the corresponding data.
Here is an example:
Format value for GERNE
Format string: $if($eql($regexp('ABBA;Pop;Disco-Pop;70s',(.*?);.*,$1),%artist%),'ABBA;Pop;Disco-Pop;70s',%artist%)
You would have to create a copy of this action with the data for each artist you want to unify.

If you realize that you can do it without the lookup table but directly in MP3tag then the string could be shortend to
$if($eql(%artist%,ABBA),'Pop;Disco-Pop;70s',%artist%)