How to create Action for Convert Filename - Tag

Hello! I'm struggling to make a full automation of changes in my fields. I want to create an Action that converts Filename into Tag. I know I can do it manually in the converter, but I wanted to make it using Actions.

Eg. 100 - File.mp3

Track: 100

Also, I'd like to fill blank Genres with a specific word, like "Unknown". I tried to create a regular expression, but I'm not able to leave the field blank.


The action equivalent for the convert functions is an action of the type "Guess value" for
Source: %_FILENAME%
Guessing pattern: %track% - %dummy%

To fill genres with "unknown", use an action of the type "Format value" for GENRE
Format String: Unknown

Thanks for the help!

I just need some changes now. I wanted that the track could be in the format "77", when the filename is 077. How could I do it?

And about the Genre doubt, I'll try to explain again. I want to select all tracks at once and play that action. Some of the tracks have empty Genres, and I would like to replace empty blank spaces with the word "Unknown". Can I do it?

If you are willing to help me with this one last question:

I also want to replace the value of COPYRIGHT with the same COPYRIGHT value, with the marker "ā„— " before. How can I do that? Thank you in advance!

Action "FOrmat value" for track
Format string: $num(%track%,1)

Format value for GENRE
Format string: $if2(%genre%,unknown)

see faqs: /t/967/1

Thank you! But the second code did not work, it did not filled empty genres with the word Unknown. Could you please check that?

I can't at the moment - I would try

Didn't work either.. :frowning:

This is a little astounding - I found a thread with a very similar problem and a very similar solution:

Are you sure that you used $if2() and not just $if()?

Yes, I'm sure. The thing is that the funcion compares if it exists, while it shoud return Y, if X doesn't exist, which is, return Unknown if %genre% doesn't exist..

Oh, I see.
so perhaps

It didn't work. I tried $if($eql(%genre%,),'Unknown',%genre%), but no success. :confused:

I don't know what you are doing because I just tested it and both work:

if2(%genre%,'unknown') -> no genre = "unknown" otherwise the genre string e.g. "Blues"
$if($eql(%genre%,),'Unknown',%genre%) -> same here

So: where and how do you apply the expressions?

I understood what's happening. I tried the function isolated, and it worked. But it didn't work among other functions in a single Action. I've uploaded my actions. Do you know why?

What I notice is that you replace text constants like "Brasilianische Musik;" with the pattern matching replace with regular expression although you do not use a regular expression. A simple replace would be enough.

What I would try: move the new action upwards in the order and see whether it works.

Thank you! You're a genius. Worked like a charm.