When using Alt-1 to rename files and folders...

...base on tags, is there a way of removing the old folders if their files have been moved to new ones?

I notice that files can be renamed so there's no duplicates, but it seems that new folders are created when a script demands it, whilst the original ones remain. Can't Mp3tag remember what the old folders were called and remove them if they're empty?

I ask because it can be quite a nuisance having to remove the empty folders manually. Unless there's a Windows task that can do that instead?

You can use a handy little freeware utility called Remove Empty Directories.

It is all a question of workflow.
If you insist on renaming all files with a fully qualified filename (path plus filename plus extension) then you might end up with empty folders.
If you only rename the bare filename without any path components and then rename the _DIRECTORY, all files in that directory/folder get moved along and no empty folders are left over.
Renaming the _DIRECTORY implies that the folder structure is already correct and no files actually have to be moved to new folders but are already in the correct folder. Only the folder has not yet got the correct name.
You achieve this with an action group and 2 actions of the type "Format value", one for _FILENAME and one for _DIRECTORY.

I'm not quite sure I understand the explanation, Ohrenkino.

In thread Strange Tag to Filename issue you use

$trim($left(%albumartist%,40))  $trim($left(%album%,40))\$num(%discnumber%,1) $num(%track%,2)  $trim($left(%title%,40))

for the function Convert>Tag-Filename, so I take this as an example.
The Convert function really aimes at the filename. Which is
$num(%discnumber%,1) $num(%track%,2) $trim($left(%title%,40))
on its own.
The rest in the heading part is...
$trim($left(%albumartist%,40)) $trim($left(%album%,40))
This describes the folder name.

Let us assume that the files are all grouped in the correct folders, only the filename is not quite up to the mark, then it would be enough to modify only the filename. The convert function Alt-1 it fine for that - the only restriction: do not include any parameters to also rename the folder.
The filename is represented by the MP3tag variable _FILENAME.
After the correctly grouped files got renamed, you may now have a look at the folder name. If you rename a folder, then the renaming really aimes only at the folder name and when executed, takes with it all files that reside in that folder.
The folder name is represented by the MP3tag variable _DIRECTORY.
To manipulate the _DIRECTORY, you may use Convert>Tag-Tag for _DIRECTORY and use as string:
$trim($left(%albumartist%,40)) $trim($left(%album%,40))

So, in fact, you manipulate 2 entities: _FILENAME and _DIRECTORY. If you do it in one go for the renaming, you may be left with empty folders, so the second step would then be to delete the empty folders.
To avoid the empty folders, it would be an option to create the actions:
First action:
Format value for _FILENAME
Format string: $num(%discnumber%,1) $num(%track%,2) $trim($left(%title%,40))
Second action:
Format value for _DIRECTORY
Format string: $trim($left(%albumartist%,40)) $trim($left(%album%,40))

This sequence will avoid empty folders.

Tried it, and it worked just how I wanted! Thanks!

It also seems to me that the Actions can do everything that the Alt-1 to Alt-5 counterparts do, so I'll stick with Actions from now on.

Also, is there a way of exporting an Action group into a plain text file? I've put a lot of work into at least a couple of them, and I would like to preserve them in some printable form in case of data loss.

OOPS! Spoke too soon!

Seems like there's still a "cannot find the file specified" when using the above method on some albums, although I cannot figure out why. The problem is, the message that appears on screen I can't even copy and paste here because it's not selectable text.

EDIT: Tried separating the two actions you mentioned above and doing each separately, but if I'm right, Actions work on each and every file in the Current Directory, right? If so, that's fine for renaming files, but renaming a folder for every single file seems like overkill and was really slowing down the computer when I tried it. What am I doing wrong?

I tried this within a single action group, but whilst it worked a lot of the time, sometimes there would be conflicts, most likely with both files and folders being renamed for every single song in the album.

So I separated them into single actions.

File renaming was fast and simple.

However, I noticed that renaming folders took a very long time and some folders were missed out. I actually had to run the process again to deal with the ones left behind the first time.

Does Mp3tag really try to rename the folder for every single song? When all it needs is a simple rename per album?

So there must be differences in the fields ...
The assumption was probably wrong that all files in a folder are properly tagged (same data for corresponding fields) and are therefore in the correct folders... You should check the data first.

MP3tag usually grabs the data from the first file in a folder and renames the folder. If the data in the following files in that folder is the same, it is just a single renaming process for that folder.
If there are differences between the files, then the renaming starts again. This could then lead to the "file not found" error as that file then is in a different folder than it should be according to the data as a previous file renamed the folder.
This might be the reason why you got duplicate folders.

In what order are the files processed? Is it in the order that they appear in the main Mp3tag window? I've always sorted everything by album, disc number and track number, I figured that was all that was needed. Then again, I find when I want to sort, I click on the track number so it's ascending, then click on disc number then again on album to make sure the order is fine. Unless there's an easier way?


Not sure if easier, but fewer clicks:
e.g. if you always sort by ALBUM, DISCNUMBER, TRACK, you may enter this a ssort criteria for the column definition field "sort by":
So everytime you click on the column header for TRACK, the "sort by" string is used for sorting.