Changing Tag Field Names (VobisComments)

In a previous thread, I learned how to configure an action item to change a Vorbis Comment field name from, say, ORGANIZATION to PUBLISHER, associating the original tag's value with the new field name. The action item looks like this:

Format value "PUBLISHER":%organization%"
Remove fields "ORGANIZATION"

This works well but only if you run the action item once. Otherwise, it has a serious drawback. If one accidentally runs the action item twice on the same file (quite possible if you're processing a large number of albums at once), this action will remove the PUBLISHER tag and of course it's value, as the undesired tag ORGANIZATION no longer exists. The resulting impact of the loss of information should be obvious.

Is there a conditional means to prevent this action item from running IF the ORGANIZATION tag is not present in the first place?



Try this:

Action type: Format value
Format string: $if2(%publisher%,%organization%)

This keeps the value of PUBLISHER if PUBLISHER already exists.

But beware of any default or user-defined mapping.
If PUBLISHER and ORGANIZATION have a mapping relationship, undesired results may occur.
My installation has PUBLISHER mapped to ORGANIZATION for the VorbisComment tag and the action has no effect.

Very good point. If working with FLAC or Ogg Vorbis files, you need to remove the mapping from the defaults in order to be able to work with both fields.

We deal only with FLAC files for our radio station music library, and thus we only work with Vorbis Comment tags. The basic set of Vorbis Comments is inadequate for our purposes, so we've selected a combination of standard, modified standard and extended tags to suite our purposes. As a result, we do not need or use any user-defined mapping. Instead, we prefer to use action items to get the desired results. After ripping with dbpoweramp, we post-process the files with mp3tag.

An example of an extended tag is ALBUMARTIST, whereas ARTIST becomes a modified standard tag that essentially means "lead or principle artist(s) on a given track, and where PERFORMER denotes each player/performer on a given track regardless of their overall importance. The format is like this:

ARTIST=Ralph Stanley
ARTIST=Dwight Yoakam
PERFORMER=Ralph Stanely (Vocals, banjo)
PERFORMER=Dwight Yoakam (Vocals)
PERFORMER=Somebody (Background vocals, guitar)

User-defined mapping is not an issue, but post-processing after ripping is important to ensure that field names and values are consistent. Unfortunately, dbpoweramp pre-defines some tags that we cannot change, and the latest version 14.3 does not give us the flexibility to rip CDs with the desired metadata field names for some tags.

JJ's suggestion appears to do what we need. Thanks!



This appears to do just what we want, but I'm at a loss as to why. Can you explain the script in plain English?

Can you point me to reference material that would help us learn the scripting language used in mp3tag. None of the steps appear obvious to me, but I have little experience with these techniques.


This is most (or all) of the documentation of the scripting language:

$if2() is kind of an oddball $if() statement, as explained on the Help page. If the first part is true, return the first part, else return the second.