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.