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

**URL:** https://community.mp3tag.de/t/when-using-alt-1-to-rename-files-and-folders/16731
**Category:** General Discussion
**Created:** [March 22, 2015, 8:49pm UTC](https://community.mp3tag.de/t/when-using-alt-1-to-rename-files-and-folders/16731 "2015-03-22T20:49:46Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 23, 2015, 10:05am UTC](https://community.mp3tag.de/t/when-using-alt-1-to-rename-files-and-folders/16731/5 "2015-03-23T10:05:04Z")

</div>

In thread [Strange Tag to Filename issue](https://community.mp3tag.de/t/16727/15) 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.

---

_[View the full topic](https://community.mp3tag.de/t/when-using-alt-1-to-rename-files-and-folders/16731)._
