Need help setting up a filenaming script

Tags: #<Tag:0x00007f0508761ce0>


I’m looking to set up an iPod strictly for in-car use, and to sort out my music collection for potentially setting up a PC-based jukebox for my bar. I just started sorting through my files, and after a few restarts and attempts to suss out what the scripting is doing, I simply need to ask for help to avoid tearing my hair out.

How I’d like my files to be arranged:

Generic Master Folder / Artist Name – Album Title / Track # - Title

For Various Artist albums (for this example, I’ll use the Now! Discs), I’d like the files sorted out as follows:

Generic Master Folder / Album Title (Now!, in this case) - Various Artists / Track # - Title

How would I go about setting this up, and is this then entered into the “Name Files Like This” box in the options tab under File Naming?

I’d like to strip out some of the additional tags that I wouldn’t require, such as composers, performers, etc, but I can easily strip anything else out with puddletag, so that’s not a concern for me, I simply want to get my music sorted in the above named fashion.

One of the few things I’ve noticed that might prove handy is the itunesalbumsortorder tag. I’ve had issues with iTunes messing up how I want things to show up, and this seems like it might help keep my library in check. I’ve noticed there’s seemingly no set way that the itunesalbumsortorder tag is applied. In one instance, it is set as Smith, John, and for another folder, it will be set as John Smith. For this particular tag, I would prefer the tag to be set as First Name Last Name for everything that would be a person’s name, and as above, for any other various artists setup, I’d like it to be read as Album Title Various Artists.

Thanks in advance for your assistance.


You could try mine. Options are at the bottom to set it up how you like.

			$set(MainFolder1,-= $upper($left(%albumartist%,1)) =-/)
			$set(MainFolder2,-= $upper($left(%albumartistsort%,1)) =-/)
			$set(Album1,$replace($rreplace(%album%,[_:*?"<>|], -),?,)$if(%date%,$if(%album%, )[$left(%date%,4)])/)
			$set(Album2,$replace($rreplace(%album%,[_:*?"<>|], -),?,)/)
			$set(MultiDisc1,$if($gt(%totaldiscs%,1),Disc $num(%discnumber%,1)/)
			$set(PreTitle1,$replace($rreplace(%albumartist% - %album% -,[_:*?"<>|], -),?,))
			$set(Track1, $num(%tracknumber%,2) - )
			$set(Track2, $num(%discnumber%,1)-$num(%tracknumber%,2) - ))

$noop( *** The Following will use the example of artist: Amy Winehouse and album: Back to Black *** )
$noop( *** Default output: -=A =-/Amy Winehouse/Back to Black [2007]/Disc 1/Amy Winehouse - Back to Black - 01 - Rehab *** )
$noop( *** Change the NUMERICAL value ONLY! Example: %MainFolder1% would be changed to %MainFolder2% *** )
$noop( *** Only change the numerical value to either 1 or 2, anything else will mess things up. *** )
%MainFolder1%	$noop( OPTION 1 -= A=- | OPTION 2 -= W =- | OPTION 3 = No single character folder will be created. )
%Artist1%			$noop( OPTION 1 = Amy WineHouse| OPTION 2 = Winehouse, Amy )
%Album1%			$noop( OPTION 1 = Back to Black [2007] | OPTION 2 = Back to Black )
%MultiDisc1%		$noop( OPTION 1 = If album has more than 1 Disc, then add Disc folders | OPTION 2 = Do not sort by Disc, put all files into a single folder. )
%PreTitle1%		$noop( OPTION 1 = Show Artist and Album in the track title | OPTION 2 = Do not display Artist or Album)
%Track1%			$noop( OPTION 1 = Track Number: 01 | OPTION 2: Track Number: 1-01-> This is best if MultiDisc is set to 2, because you will have 2 track numbers as 01 - *track names*, etc. )
%Title%				$noop( NO OPTION - Just display the name of the track. )


That worked to sort out a few different things for me, and also introduced a whole lot of scripting stuff I don’t quite follow LOL

Through using a sandboxed sample of files, I was able to figure out some things to add/subtract to get the single-artist albums sorted out with your script. It also introduced some multiple-disc sorting that I hadn’t considered (an artist with an album spanning multiple discs).

Sorting the various artists albums doesn’t work as I was hoping, and I am not able to suss out too much of the scripting language to figure it out myself yet.