Tag -> File rename

Hi everybody :rolleyes:
I'm new on the forum and this is my first post.
I just discovered the fantastic Beatport script by Stevehero (thanks to him!) that make me saving a lot of time.
Now, I would like to use the Tag -> File rename function to save more time than ever.

I've found how to rename my mp3s like this: 01-Artist Name-Track Name.mp3

But I would like to rename like that: 01-artist_name-track_name_[publisher_name].mp3

Is it possible EXACTLY like that? I really want all tiny characters and the label (publisher) at the end of each file between []

Another question: is it possible to ask mp3tag to rename my playlist.m3u the same name than the parent folder, and if possible, also with all tiny characters?

Example: 00-artist_name-album_name-(catalog_number).m3u

Thanks a lot for you help!

Format String:

To rename your playlist you have to use the wanted placeholders in Tools/Options/Playlist/Filename of playlist. I don't know in which way in your example the parent directory in represented.
Using the parent directory you would have to fill in

Excellent !!! :w00t:
Thank you very much for your rapid answer, will try this NOW :laughing:
See Ya!

Thank you for the format string but I just need a little adjustment.
Indeed, for the moment it goes like that : 01-artist name-track name-[publisher name]

I would like that result instead : 01-artist_name-track_name_[publisher_name].mp3

So the changes are about a _ between each word instread of a space, and another _ before the [publisher_name].

Thank you ! :rolleyes:

... to do ...

  • format track number as 2-digit number
  • enclose data from the tag-field PUBLISHER into square brackets,
    ... protect against non existing publisher,
    ... add it as last part to the filename
  • replace each space character with one underline character
  • convert all characters into lower casing
Action "Format value" or Convert "Tag - Tag" Field ......: _FILENAME Formatstring: $lower($replace($num(%TRACK%,2)'-'%ARTIST%'-'%TITLE%[' ['%PUBLISHER%']'],' ','_'))


Very interesting thanks.
If I understand well, I have to put those 3 lines in the sript from stevehero ?

Action "Format value" or Convert "Tag - Tag"
Field ......: FILENAME
Formatstring: $lower($replace($num(%TRACK%,2)'-'%ARTIST%'-'%TITLE%[' ['%PUBLISHER%']'],' ','

And If i'm good, where exactly ?



Sorry for my misunderstanding so :unsure:
I just pasted the formatstring onto the Tag -> Filename and it's just perfect !

But, maybe you gave me that 3 lines to make Mp3Tag auto rename my selected mp3s without having to go to Tag -> Filename right ?

I'm feeling like a noob, even if i'm using mp3tag for more than 3 years lol It's just that I had never discovered the advanced functions of that powerfull software.

Thanks again for your further explanations :rolleyes:

I've Found the Action Option, that's OK :laughing:

I have a question about that format string.
Indeed, If my directory is :


my playlist will be : 0401.m3u

and not : artist_name-album_name-(catalog)-web-2014.m3u

Any Idea ?

If you use the full path as filename, then this illegal. You could use the function $validate() to get rid of the illegal characters in the filename.

You asked fpr the parent directory. But what you obviously are looking for is the directory and not the parent directory.

Oh yes, you're right !
My english might not be perfect :huh:

Now I'm trying to create a new Action for the Directory.
Indeed, I'm still creating the Dir manualy, what a lack of time :flushed:

I want this result as you already know : Artist_Name-Album_Name-(CATNUMBER)-WEB-2014

My album tag already contains the Cat Number like that : Album Name (CATNUMBER).

So I did : Action / Format Value / Field : _DIRECTORY

The only format string I could create is : %artist%-%album%-WEB-2014

So that makes : Artist Name-Album Name (CATNUMBER)-WEB-2014

Even after trying to analyse your previous format string for the filename, I'm still not able to replace each space character with one underline character.
And not able to replace the underline character before the (CATNUMBER) with a -


Be aware of, when working with the "pseudo tag-field" _FILENAME or _DIRECTORY, then you manipulate the file path name or folder path name of the one related media file.
Be aware of, when renaming a folder path name, then at once all files in the original folder will be touched too.
My advice is: Prepare such manipulations on the filesystem by using one or more temporary tag-fields.
This way you have full control of the result without getting into chaos on your disk.

You can create a group of actions to work out and define each single step on your way to the final result.
If the preview result is looking good, then and only then add the very last action step to set the "pseudo tag-field" _FILENAME or _DIRECTORY.

Be aware of, that the "pseudo tag-field" _FILENAME or _DIRECTORY can change the entire path name, starting from the location of media file up to the disk root.

For example ...

  • Create a new action group with a name of your choice.

  • Add action "Format value" to create a temporary tag-field ...
    Field: ARTIST_NEW
    Formatstring: %ARTIST%

  • Add action "Format value" to create a temporary tag-field ...
    Field: ALBUM_NEW
    Formatstring: %ALBUM%
    ... and so on for each tag-field, which you want to manipulate.

  • Add action "Replace"
    Field: %ARTIST_NEW%
    Replace with:

  • Add action "Replace"
    Field: %ALBUM_NEW%
    Replace with:
    ... and so on for each tag-field, which you want to manipulate.

Assemble the new values into one formatstring ...

  • Add action "Format value"
    Formatstring: %ARTIST_NEW%'-'%ALBUM_NEW%

If the content of the tag-field FILENAME_NEW looks ok, then apply it to the file system ...

  • Add action "Format value"
    Field: _FILENAME
    Formatstring: %FILENAME_NEW%

At last remove all temporary tag-fields ...

  • Add action "Remove fields"



Thank You for your detailed explanations, they are very instructive.
I try to understand all the components of your tutorial but It's not so easy for me, as you can imagine...
I'm near from my goal anyway, but i'm still not able to have the result I want for the Directory.

The best I can have is : Artist Name-Album Name (CATNUBER)-WEB-2014

Still not able to replace the spaces with underlines and the space before (CATNUMBER) with a -


You already know the action "Replace" and you know the scripting function $replace().
The purpose of these helpers is to replace a given string by another given string.
So you can replace the string ' (' by the string '-('.
So you can replace a space character ' ' by an underline character '_'.


Yes I've found :w00t:

Thank you for all your help, I'll save a lot of time now :laughing:
Hope to be helpful myself in the future !
See Ya !