Can't write proper Actions scrip to achieve need

I have nearly 5000 Mp3 songs where I have noted composers name, e.g. George Bassman-Ned Washington I now realize a name itself may be hyphenated, so I would like to do a bulk change to use " / " instead of the hyphen.
I have never used ACTIONS before but gave it a try. So, I set-up a new ACTION called "Replace Hyphen" and using the EDIT tab my attempts to fill in the requirements result in Regular expression "Composer": Find "ALL": "-" -> " / "
A test of one song changes nothing and gave message "Formatted tags in 0 of 1 files. 0 of 1 files renamed. What am I doing wrong?

Which type of action did you use?
Can you show us by a screenshot what you did exactly?

Use an action of the type "Replace" (not "Replace with regular expression) for COMPOSER
Search: -
Replace with: /

I don't know, though, if such an action should be carried out unattended as there are a number of names that have the hypen as regular feature. E.g. Olivia Newton-John, a-ha, Franz-Josef Selig, Anne-Sophie Mutter, B-52's, Camille Saint-Saëns, Deee-Lite
and many more

I followed your suggestion and initially thought the result was better than I expected. I thought result would be e.g. Al Dubin/Harry Warren but instead got Al Dubin / Harry Warren which is even better as I though perhaps another ACTION could be run that would change any / preceded and followed by a wildcard representing any non blank could change the / back to a hyphen.

Then I noticed of my test file of 56 songs, 3 did not get the spaces e.g. Stanley Adams/Milton Ager

Worse still, when I clicked SAVE TAG both Al Dubin / Harry Warren and Stanley Adams/Milton Ager along with the other 54 songs now all have ; followed by a space e.g. Stanley Adams; Milton Ager

Do you have any suggestions as to what is happening?


Then I assume that all the other tracks did not have only a hyphen but actually blank hyphen blank.

What did you do that for? As soon as you run an action, the modification by that action is saved immediately.

where do you see that? in MP3tag or in your player?
I seriously doubt that you see that change in MP3tag.
I suspect that this is the player's display - and that treats the slash as separator for multi-value entires and now shows its own separator.

My first step was to create an empty file named Mp3tag Files.
I then copied 56 records from my collection file of nearly 5000 songs and placed them in Mp3tag Files.
I opened Mp3tag program, selected Change Directory and pointed to Mp3tag Files.
That filled in the composer column.
I then clicked on Action and selected Replace Hyphen.
What I then saw was 53 of the 56 songs had the Al Dubin / Harry Warren result.
Checking original from collection had Al Dubin-Harry Warren with no extra space.
The other 3 files appeared as Stanley Adams/Milton Ager and I now realize that the composer field of all 3 original and consequently test file records did not have the 2 composers separated by a hyphen, but rather semi-colon followed by a space.
However, to complete the effort, the change appearing on the Mp3tag screen had to be applied to the test file to prove everything worked correctly. That's when I clicked Save tag. The result was as indicated previously all 56 records in the test file now appeared as per my example, Stanley Adams; Milton Ager.

Now things really get interesting. I corrected the 3 errors with a hyphen. Reloaded my 56 files into my test file, pointed Mp3tag at the test file and re-executed Replace Hyphen. All 56 records now have / with a space preceding and following. Just what I wanted, although I now realize that compound names will also have a space each side of the / and my idea of using a wild card won't work. Fortunately in building my collection I have only seen a very few instances.

Thank you for your patience and assistance.

I cannot look over you shoulder an therefore I don't know what you entered in the action.
Yet, it is absolutely certain, that MP3tag does not invent any additional space characters.

You can use the converter TAG->Tag to get an immediate preview for the first file of the selection and an overall preview with the Preview-button. Therefore it is always a good idea to use the coverter to test and define an action later.

Format String: $replace(%composer%,-,/)

I am unsure how to do screen shots on my PC using Windows 10. So, today I setup a new ACTION and step by step preceded to create it following what I believed was required by the software, i.e. using ACTIONS on the header bar and then selecting NEW and following seemingly appropriate steps.
I clicking ACTION on the header bar gives me the ACTION GROUPS drop-down screen. From it I selected NEW on right side and keyed TEMP.
Clicking EDIT seemed to achieve nothing at that point, so I again clicked NEW.
The 1st click seemed to permit assigning a name to my action. The 2nd click on NEW resulted in a new drop-down SELECT ACTION TYPE with a multiple choice arrow.
I chose REPLACE and OK giving another drop-down entitled REPLACE with 3 multiple choice fields to be filled in.
The 1st, FIELD, I selected COMPOSER. The 2nd, ORIGINAL, the options to select weren't suitable so I keyed - and finally, the 3rd, again no suitable option so I keyed /
When I use EDIT to show what I now have, it appears as
REPLACE "COMPOSER": "-" -> "/"
The quote marks seemed to have been generated by Mp3tag.
Anyway, I then executed the Action against a single record in a test file with my original composer name Al Dubin-Harry Warren
The result on the Mp3tag screen has changed to Al Dubin/Harry Warren
Just what I wanted test file now has Al Dubin; Harry Warren
The resulting semicolon has also separated the two individuals as a single entity.
My own thought is that it has something to do with the Properties Field placing a semicolon following each entity. The original Al Dubin-Harry Warren was a single entity and defined by Properties as Al Dubin-Harry Warren;
Showing Properties, the new is Al Dubin; Harry Warren; and has neither - nor /
Any thought?

But this is not displayed by MP3tag but by a different program, right?

As a side note:

Press your Windows Key + SHIFT + S (all 3 together).

This will dim your complete screen, where you can draw a rectangle for the region you want to take a screenshot. As soon as you release your left mouse button, the screenshot will be ready automatically in your (invisible) clipboard.

Then you go to your target (like the answer box in this forum, or your Word processing software, or your graphics program) and press CTRL + V to insert your rectangle from the clipboard.

This is a Howto from Microsoft about their built-in Snipping Tool.

Correct. I use Windows 10 and to setup the new folder titled TEMP I clicked on FILE MANAGER. I then copied the Mp3 record from another FILE MANAGER folder into it. I then chose the new folder for CHANGE DIRECTORY in Mp3tag. Having executed my new ACTION and seen the good result on the Mp3tag screen I then went back and checked the result in TEMP. Other than that no other product was involved unless you also include clicking on PROPERTIES. It is when using PROPERTIES that it is apparent that I now have each name as a separate entity with a semicolon following each.

And if you look at the very same files in MP3tag - is it a semicolon or the slash?

Thanks for that info. I had never heard of Snipping Tool before. I only knew that my keyboard had a button called PrtScn but clicking it never seemed to achieve anything.

1 Like

Here is a an article in Wikipedia about PrtScn

The - has been changed to / which is just what I wanted but not just on the Mp3tag screen.

Well, you see that this problem is one of the other application.
MP3tag can hardly to anything about how a third party product interprets certain characters.
The only button that you can twiddle is to use a different character than the slash as this is apparently one that causes problems for you.
Another way out would be to use a player/display program that shows the characters as they are and not translate them to something else.

You are talking above my skill set level as I don't have a clue what a player/display program is. Other than Mp3tag, the only other product involved is Microsoft's File Explorer. My intent is that once I can achieve changing the - to / I will then be using VLC to play the music. But I haven't reached that stage yet. Do you suggest I inform Microsoft there is a problem with their software? But first I will try your suggestion using another character rather than slash. Did you perhaps try to replicate my issue following the steps I outlined in my previous post and did you then see the same result? If it worked for you, were you using a product other than Microsoft Windows?

You would appear to be correct about the slash. I used UNDO FORMAT to restore the - in my test record, then changed the ACTION to replace / with & and it not only worked for the Mp3tag screen but also the actual file record. Two individuals names were still treated as an entity. Its unfortunate as I know that the COMPOSER field on my records is often e.g. George & Ira Gershwin, much more often than e.g. Olivia Newton-John. My songs are all from the Big Band era and I have only seen a very few hyphenated surnames. Anyway unless I can find another way to do a bulk change utilizing the slash, I'll just have to live with the hyphen. Thanks again for your assistance.

My compromise solution requires using my limited ability for creating ACTIONs will require running the 5000 records file through MP3tag twice, which I am sure will take quite a while to run, Anyway I have tested and I'm not satisfied with the result.
Step one, execute an ACTION changing all - to ~-~
Then run a 2nd ACTION replacing ~ leaving the REPLACE WITH field blank.
Unfortunately the result is e.g. Al Dubin - Harry Warren
I don't understand why it results in double spaces each side of the hyphen.
I would have preferred Al Dubin - Harry Warren if I couldn't have Al Dubin/Harry Warren so I'm not sure I will proceed.