Question on Actions - Is there a "Switch Case" like function?

This is my first post. I am trying to update my music files with two types of Key Information. I am a DJ and want to show both Camelot and Major/Minor Keys in my Tags. To do that I am using a Tag field that I do not use and re-purposing it. The unused field is ORIGARTIST. Which will hold my Camelot Key, the %initialkey% tag will hold my Major/Minor. My problem is that I had to create 25 different actions to allow me to do all of the conversions.

Assume that I initially have the Camelot Key in the %initialkey% tag. I created my first action to copy %initialkey% to ORIGARTIST. That code is:


Next I have 24 Conversion Actions depending on the Camelot Key (1A,1B to 12A, 12B) I look to see if the ORIGARTIST matches the Camelot Key I am looking for and if so I replace the %initialkey% with the corresponding Major/Minor Key. That code is (for Camelot Key 1B):


So in order for me to tag a number of files I have to do the Copy Action, then sort all of the files by Camelot Key, then select the files with the same key, and run that Key's action.

Is there a way to combine all of my conversion Actions into one like a Switch Case (in the C programming language)?

For instance

case 1A:
case 1B:

Sorry for the long winded explanation, but I wanted to be clear. Any thoughts on how I could do this with the current Action interface?

Thanks In Advance!

If you have pairs of values, like

You can use an action of the type "Format value" for the target field with
Format string: $replace(%camelotkey%,1A,Abm,1B,B)

Add the pairs of values in the format string.

Are you saying that the $replace function can do all values at once? I will have to look into that. Thanks Much!

Works Great!!! Thanks so much!

Oops...I seem to have found a problem that I'm hoping you can help resolve, here is the code I am using for the Action


The problem I am seeing is that when the function comes up to the 11A search, it sees the 1A first and gets confused and uses the 1A replacement. How can i make the replace specifically look for 11A instead of 1A? I tried quotes and the [] but neither helped...

Again Thanks in Advance!

You can try reordering the replacements so that 11A is replaced before 1A.

The behaviour is just like with a set of actions in an action group where you have to reorder the actions so that each pair of search and replace strings is treated only once.

Thanks Florian, Reordering did the trick! Much Appreciated. I just sent in another donation yesterday. I have done this for the last few years as I really appreciate this software!

1 Like