# Help creating Action to get Composer in Filename

**URL:** <https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990>\
**Category:** Support\
**Created:** [August 24, 2013, 7:17pm UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990 "2013-08-24T19:17:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sigrun](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/eb9ed0/32.png) [@sigrun](https://community.mp3tag.de/u/sigrun)\
**Post date:** [August 24, 2013, 7:17pm UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990/1 "2013-08-24T19:17:11Z")

</div>

So I have the COMPOSER field filled like this:

```
Frédéric Chopin (1810–49)

```

And the TITLE field filled like this:

```
Polonaise #5 in F-sharp minor, op. 44

```

How can I create an Action to make the FILENAME field be like this:

```
01. CHOPIN_ Polonaise #5 in F-sharp minor, op. 44.mp3

```

So that's TRACK. COMPOSER(surname & caps only)\_ TITLE.mp3

Thanks!

---

<div class="post-metadata">

**Author:** ![garym](https://community.mp3tag.de/user_avatar/community.mp3tag.de/garym/32/4822_2.png) [@garym](https://community.mp3tag.de/u/garym)\
**Post date:** [August 24, 2013, 9:57pm UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990/2 "2013-08-24T21:57:10Z")

</div>

use CONVERT \> tag to filename, with mask:

$num(%track%,2). %composer%\_%title%

But this will put the entire composer name and date in as composer. So you need a method to pull out just the part of the composer name you want. Perhaps someone else can help with that. Plus there is probably a way to tell mp3tag to make all those filename parts all caps, but I'll have to dig deeper for that as I haven't used that option.

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 24, 2013, 11:02pm UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990/3 "2013-08-24T23:02:15Z")

</div>

> [@sigrun](#):
>
> So I have the COMPOSER field filled like this:
> 
> ```
> Frédéric Chopin (1810–49)
> 
> ```
> 
> And the TITLE field filled like this:
> 
> ```
> Polonaise #5 in F-sharp minor, op. 44
> 
> ```
> 
> How can I create an Action to make the FILENAME field be like this:
> 
> ```
> 01. CHOPIN_ Polonaise #5 in F-sharp minor, op. 44.mp3
> 
> ```
> 
> So that's TRACK. COMPOSER(surname & caps only)\_ TITLE.mp3
> 
> Thanks!

**Action #1** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **\_FILENAME** _Formatstring:_ **$num(%track%,2). $upper($regexp(%composer%,'^[^\s]+\s([^\s]+).\*',$1))\_%title%**

---

<div class="post-metadata">

**Author:** ![sigrun](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/eb9ed0/32.png) [@sigrun](https://community.mp3tag.de/u/sigrun)\
**Post date:** [August 25, 2013, 9:28am UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990/4 "2013-08-25T09:28:43Z")

</div>

stevehero, that works brilliantly, thanks!

The only problem now is dealing with Composers with three names. So for example "Wolfgang Amadeus Mozart" comes out as "AMADEUS" using that action.

I can create a simple rule for each of these to replace AMADEUS with MOZART, VAN with BEETHOVEN, etc..

But is it possible to build the original action, or add a new one, that would take the third name if there are three? Or take the first name to the left of the year brackets?

Thanks again!

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 25, 2013, 11:00am UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990/5 "2013-08-25T11:00:33Z")

</div>

The old action grabs the 2nd word whereas this will grab the last word before the

_\_(YEAR.$_   
\_ is space  
YEAR is 4 digit year  
. matches anything any number of times  
$ anchors the regexp to the end of the string.

.+\s([^\s]+)\s+(\d\d\d\d.\*$

Begin Action Group **\_FIXED ACTION**

**Action #1** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **\_FILENAME** _Formatstring:_ **$num(%track%,2). $upper($regexp(%composer%,'.+\s([^\s]+)\s+\(\d\d\d\d.\*$,$1))\_%title%**

End Action Group **\_FIXED ACTION** (1 Action)

---

<div class="post-metadata">

**Author:** ![sigrun](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/eb9ed0/32.png) [@sigrun](https://community.mp3tag.de/u/sigrun)\
**Post date:** [August 25, 2013, 12:38pm UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990/6 "2013-08-25T12:38:59Z")

</div>

I actually got a "Syntax Error" with that, but I compared it with the other one & put in a ' after the the second last $

**$num(%track%,2). $upper($regexp(%composer%,'.+\s([^\s]+)\s+(\d\d\d\d.\*$',$1))\_%title%**

Not really sure what that does, but it seems to work now!!

Thanks for your help! It's one hell of an Action!

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 25, 2013, 1:22pm UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990/7 "2013-08-25T13:22:44Z")

</div>

Sometimes that happens when you paste the action into the forum.. It got rid of the $ before the '. Looks like I missed that. Glad you got found the solution.

As regards the ' at the start and end of the **expr**. I tend to put that in all my **$regexp(x,expr,repl)**  
 like  
 **$regexp(x,'expr',repl)**  
and even  
**$regexp(x,'expr','repl')** when needs be.

I can't find where it says that in the help but it's good to be aware of that.

---

<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:24pm UTC](https://community.mp3tag.de/t/help-creating-action-to-get-composer-in-filename/14990/8 "2026-02-09T12:24:38Z")

</div>

Closed on February 9, 2026, 12:24pm UTC


