Feature Suggestion: Folder rename


I've been using Mp3Tag for years. Recently tasked myself with organizing my evergrowing music collection and decided to try other options. Guess what? None of those is close to Mp3Tag feature-wise and speed-wise! :slight_smile:

One feature I liked in TagTuner though - rename current folder using tag data. That is, if I'm on the file with Artist X and Album Y, pressing the key combo would rename the parent folder according to my pattern as "Artist X - Year Z - Album Y". Huge timesaver! Would love to have this feature in Mp3Tag as well.


This feature is already there:
Use the action "Format tag field" on the pseudo tag "Directory", enter a mask of your liking. From your example I take it that you would like a mask like this:
%artist% - %year% - %album%

The advantage with the actions is that you can store different naming patterns for e.g. audio plays, samplers and normal albums.

One can also use converter Tag -> Filename (Alt+1) and

%artist% - %year% - %album%\\%filename%

(note the \ backslash).

%artist%\\%album%\$num(%track%,2) = %artist% = %title%work's fine for me.

The converter only touches the selected files.
An action that works on the pseudo tag directory really effects the directory and therefore not only modifies the selected files but all files in the folder.

Use the converter if the current file structure has to be expanded.
Use the formatting action if you want to modify an existing structure.

Awesome! Thanks!

BTW, is there any way to assign a keyboard shortcut to the custom action?

No, not directly, you can only press Alt-A and then the first letter (or one marked by ampersand) to trigger the action. A combination with Ctrl or something like that is not available.

Can you explain this with a capture image, please?

Edit: I did it!

This wouldn't be very useful as I use my localized German version.
The action, sorry, is called "Format value" in English.
How to create an action:
The tag field to perform the action on is
Directory (please select it from the dropdown list)
Enter a mask just like for the converter "Tag - Filename" only that this time it describes the directory and not the file.

Now is perfect.

My songs are in a hierarchy which has a folder named after the album at the lowest level. I use regular expressions in actions to clean up my tags and want the name of the folder to change when tags are updated. I use an action of type Format Value as follows:

Format String: $mid(%_folderpath%,1,$strrchr($cutRight(%_folderpath%,1),\))%album%

This renames only the last folder element of the current path to the album name and leaves the rest of the directory tree untouched.

'the last folder element of the current path' can be reached by the pseudo tag-field _DIRECTORY resp. the content can be used by %_directory%.

Instead of coding the Action 'Format Value' like following ...

Format String: $mid(%_folderpath%,1,$strrchr($cutRight(%_folderpath%,1),\))%album%

... you can write ...

Format String: %album%

... and it will do the same as the long scripting version.

If someone needs the folderpath from one step above the current directory ...
... this standard scripting will work ...


... this tricky replace will work ...


... this regular expression will work ...



I disagree.

Say I have a bunch of MP3's in the path 'C:\Temp\Test\Anjunabeats (Vol.8)'. I drop the directory 'Test' onto Mp3Tag to launch the program. Now %_directory% points to 'C:\Temp\Test' and not 'Anjunabeats (Vol.8)' which is what I mean when I say 'the last folder element of the current path'.

In my experience. %_directory% always points to the folder I drop onto Mp3Tag, which can of course be higher up in the folder hierarchy than the lowest level folder containing an Album. That's why I coded what I did.

Please do reality check again.
Run the attached export script ... and look for the %_directory% value.
20110510.Export_System_Fields.mte (2.32 KB)
Example output:
Mp3tagSystemFields.txt (4.23 KB)


Mp3tagSystemFields.txt (4.23 KB)

20110510.Export_System_Fields.mte (2.32 KB)

Sorry - my mistake. I was confused by the view in the Tag Panel which lists under the filed headed with Directory: what I guess is really _workingpath (?) and so I assumed %_directory% had this value.