Alphabetical subfolders before artist folder

Hello all, I had to recently reformat my computer and I forgot to export my naming script before doing so. I rip my CD’s to a folder, ex “D:\FLAC rips” and then had Picard add the tags and move/rename the files when I saved them. For the life of me, I cannot figure out how to recreate the folder structure in the renaming script.

The artist folder and actual file names are easy enough but I can’t remember how to get that initial folder that’s the first character of the artist name. I tried searching here but I couldn’t find the answer. Any suggestions? Thanks.

You can use the $firstalphachar function, see the documentation.

A typical use case would be adding the following script snippet to your file naming script at the position where you want to have the folder.

$firstalphachar(%albumartistsort%)/

This uses the album artist sort name, so “The Beatles” would be placed under “B” while “Michael Jackson” end up under “J”.

If you want to just use the first character of the artist name regardless whether it is an article or first name then just use %albumartist% instead of %albumartistsort%. This places The Beatles under “T” and Michael Jackson under “M”.

If you want person names filed under the first character of their first name, but still remove articles from band names, use
$swapprefix(%albumartist%) instead of just%albumartist%. Then The Beatles are under “B” but Michael Jackson under “M”.

6 Likes

Thanks, that’s definitely what I needed. I made a couple of adjustments while I’m doing this and here’s what I ended up with so far

$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#))/
$left($if2(%albumartistsort%, %artistsort%),30)/
$if2(%originalyear%,$left(%date%,4)) - %album% \($if(%date%,$left(%date%,4),----)\)$if(%label%, \(%label%\))/
$if($gt(%totaldiscs%,1),$if(%discnumber%,Disc $num(%discnumber%,1)/),)
$num(%tracknumber%,2) - $replace($replace($replace($replace($replace($replace(%title%,?,?),!,!),,),/,/),:,:),…,…)

This should work well for my normal stuff. However, it will not work the way I want on the compilations that I had going into the “Various Artists” folder. The way the script above is working, it creates a Various Artists folder under the letter V folder. If I recall correctly, I had a separate script that I used on compilations to make write to the Various Artists folder. Since I’m doing the script again anyways, I’m wondering if it’s possible to just have a single script that would check if it’s a compilation and then rename the folder/files differently than non-compilations? Here’s the way the Various Artists folders/files are structured.

At a quick glance, it looks like you want to simply leave out the first alpha character portion of the file path if it is a Various Artists album. This can be achieved by changing the first line of your script to:

$if($not(%compilation%),$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#))/)

This should work if you’re getting the metadata from MusicBrainz by matching your files to tracks on a release.

1 Like