Feature Suggestion: Folder rename


#1

Hi!

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.

Thanks!


#2

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.


#3

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.

#4

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.


#5

Awesome! Thanks!


#6

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


#7

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.


#8

Can you explain this with a capture image, please?
Thanks!

Edit: I did it!


#9

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:
/t/967/1
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.


#10

Thanks.
Now is perfect.


#11

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:

Field:_DIRECTORY
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.


#12

'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 ...

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

... you can write ...

Field:_DIRECTORY
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 ...

$mid(%_folderpath%,1,$strrchr($cutRight(%_folderpath%,1),'\'))

... this tricky replace will work ...

$replace(%_folderpath%'*',%_directory%'\*',)

... this regular expression will work ...

$regexp(%_folderpath%,'^(.+\\\\).+\\\\$','$1')

DD.20110509.1652.CEST


#13

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.


#14

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)

DD.20110510.1227.CEST

Mp3tagSystemFields.txt (4.23 KB)

20110510.Export_System_Fields.mte (2.32 KB)


#15

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.