# How to create Action for Convert Filename - Tag

**URL:** https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692
**Category:** Support
**Created:** [January 15, 2018, 11:03am UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692 "2018-01-15T11:03:33Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)
#### Post date: [January 15, 2018, 11:03am UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/1 "2018-01-15T11:03:33Z")

</div>

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.

Thanks!

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 15, 2018, 11:08am UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/2 "2018-01-15T11:08:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)
#### Post date: [January 15, 2018, 11:18am UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/3 "2018-01-15T11:18:13Z")

</div>

> [@ohrenkino](#):
>
> 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!

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 15, 2018, 11:24am UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/4 "2018-01-15T11:24:16Z")

</div>

> [@Henrique Barcelos](#):
>
> 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?

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

> [@Henrique Barcelos](#):
>
> 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?

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

> [@Henrique Barcelos](#):
>
> 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!

see faqs: [/t/967/1](https://community.mp3tag.de/t/967/1)

---

<div class="post-metadata">

### Author: ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)
#### Post date: [January 15, 2018, 11:34am UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/5 "2018-01-15T11:34:16Z")

</div>

> [@ohrenkino](#):
>
> Action "FOrmat value" for track  
> Format string: $num(%track%,1)
> 
> Format value for GENRE  
> Format string: $if2(%genre%,unknown)
> 
> see faqs: [/t/967/1](https://community.mp3tag.de/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?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 15, 2018, 11:40am UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/6 "2018-01-15T11:40:15Z")

</div>

> [@Henrique Barcelos](#):
>
> 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  
$if2(%genre%,'unknown')

---

<div class="post-metadata">

### Author: ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)
#### Post date: [January 15, 2018, 11:42am UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/7 "2018-01-15T11:42:54Z")

</div>

> [@ohrenkino](#):
>
> I can't at the moment - I would try  
> $if2(%genre%,'unknown')

Didn't work either.. ☹

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 15, 2018, 12:00pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/8 "2018-01-15T12:00:04Z")

</div>

> [@Henrique Barcelos](#):
>
> Didn't work either.. ☹

This is a little astounding - I found a thread with a very similar problem and a very similar solution:  
[/t/19099/1](https://community.mp3tag.de/t/19099/1)

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

---

<div class="post-metadata">

### Author: ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)
#### Post date: [January 15, 2018, 12:06pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/9 "2018-01-15T12:06:57Z")

</div>

> [@ohrenkino](#):
>
> This is a little astounding - I found a thread with a very similar problem and a very similar solution:  
> [/t/19099/1](https://community.mp3tag.de/t/19099/1)
> 
> 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..

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 15, 2018, 12:13pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/10 "2018-01-15T12:13:24Z")

</div>

> [@Henrique Barcelos](#):
>
> 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  
$if($eql(%genre%,),Unknown,%genre%)

---

<div class="post-metadata">

### Author: ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)
#### Post date: [January 15, 2018, 12:31pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/11 "2018-01-15T12:31:36Z")

</div>

> [@ohrenkino](#):
>
> Oh, I see.  
> so perhaps  
> $if($eql(%genre%,),Unknown,%genre%)

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

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 15, 2018, 12:51pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/12 "2018-01-15T12:51:02Z")

</div>

> [@Henrique Barcelos](#):
>
> It didn't work. I tried $if($eql(%genre%,),'Unknown',%genre%), but no success. 😕

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?

---

<div class="post-metadata">

### Author: ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)
#### Post date: [January 15, 2018, 1:27pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/13 "2018-01-15T13:27:18Z")

</div>

> [@ohrenkino](#):
>
> 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?

![](https://community.mp3tag.de/uploads/default/original/2X/e/e40e1f32e760edeeb36ebd8eaa07972b2740c67c.png)

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 15, 2018, 1:51pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/14 "2018-01-15T13:51:40Z")

</div>

> [@Henrique Barcelos](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)
#### Post date: [January 15, 2018, 2:24pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/15 "2018-01-15T14:24:12Z")

</div>

> [@ohrenkino](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:27pm UTC](https://community.mp3tag.de/t/how-to-create-action-for-convert-filename-tag/19692/16 "2026-02-09T12:27:11Z")

</div>


