File Naming

Hi everyone, maybe you can help, need a script that will take my collection and sort them to folders.
If the Artist is Alice Copper I would like it to make a folder A, then the folder Alice Copper and in that folder the year and Album.
it look like this

A
Alice Copper
2003 Album Name
If the album has more then 1 Artist name or Feat. or Various Artist, it will put all the songs in the album name and not make other folders.

Thank you for and help, I spent the last 6 days reading and am confused and missing something.

I made this but is not working right

$replace($rreplace(
$if($eq(%albumartist%,Various Artists),
[Various Artists],
$left($if2(%albumartistsort%,%artistsort%),1)/$left($rreplace($if2(%albumartistsort%,%artistsort%),; [^)]+,), 60))
/
$if(%date%,[$left(%date%,4)] )$left($replace(%album%,/,), 70)
$if($gt(%totaldiscs%,1),$if(%discnumber%, (Disc %discnumber%),),)
/
$num(%tracknumber%,2). $left(%title%,120),[:?"_]+,), , )

It makes the folders 123 ABC for the Artist and works, it does not make folders for CD1 or CD2 if there are 2 cds, it does not put all the files in one folder for feat. or various artist of the album.

what you’re wanting is quite close to the script I’m using right now
 edited slightly as I’ve got a plugin that allows me to group soundtracks and Various Artists separately, and also changed the Various Artist folder name to match your current one.

sorry about the weird formatting, as I’m adjusting it, the formatting helps me keep things straight. :wink:

$if(
	$eq(
		%musicbrainz_albumartistid%,
		89ad4ac3-39f7-470e-963a-56509c546377
		),
		[Various Artists],
		$firstalphachar(
			$if2(
				%albumartistsort%,
				%artistsort%,
				%albumartist%,
				%artist%
				),
				1-9
			)
		/
	$if2(
		%albumartist%,
		%artist%
		)
	)

/

$if(
	%date%,
	\($left(
		%date%,
		4
		)\) 
	)
$if(
	$ne(
		%album%,
		[non-album tracks]
		),
	%album%$if(
		%_releasecomment%,
		 \(%_releasecomment%\),
		)
		/,
	)
$if(
	$gt(
		%totaldiscs%,
		1
		),
	%discnumber%-,
	)
	$if(
		$and(
			%albumartist%,
			%tracknumber%
			),
	$num(
		%tracknumber%,
		2
		) ,
	)
	%title%
	$if(
		%_multiartist%,
		 - %artist%,
		)

For the letter folders, it’ll use the sort-name of an artist first, or the artist name if it doesn’t have a sort-name, favoring album artist over track artist, therefore ABBA, Bryan Adams, and The Angels should all end up under A. Also, if there’s multiple artists on an album, it’ll add the artist after the track title. Any artists that start with anything non-alphabetical, (numbers, symbols, and emoji, for instance) will be put in “1-9”. If you’ve got any [non-album tracks], it’ll put those music files in the artist folder. Lastly, if there’s a disambiguation on your release, it’ll add that in parentheses after the album title.

my script doesn’t separate into discs, but it does handle multiple discs as part of the track number, (i.e. “Radio Ga Ga” on disc 2, track 3 would be rendered as “2-03 Radio Ga Ga.mp3”). it could easily be changed to add separate disc folders if you’d like, either in the artist folder or the release (album) folder.


some actual examples from my collection, notes in {brackets}:

  • [Various Artists] {I use a “#” at the start, but you can use a different character if you want}
    • (1999) The Matrix∶ Music From the Motion Picture (Parental Advisory)
      • 01 Rock Is Dead - Marilyn Manson.mp3 {multiple artist release}
      • 02 Spybreak! (Short One) - Propellerheads.mp3
      • 03 Bad Blood - Ministry.mp3
      • 

  • 1-9
    • 4 Non Blondes
      • (1992) Bigger, Better, Faster, More!
        • 

        • 03 What’s Up.mp3 {single artist release}
        • 

  • A
    • ABBA
      • (2008) Gold∶ Greatest Hits
        • 

        • 04 Mamma Mia.mp3
    • Bryan Adams
      • (2014) Reckless (mastered for iTunes) {a couple examples of the disambiguation I mentioned}
        • 06 Summer of ’69 - Bryan Adams.m4a
    • The Angels
      • (1963) My Boyfriend’s Back (stereo)
        • 01 My Boyfriend’s Back.mp3
  • 
continues to Z

sorry for the lack of comments in the script itself
 I’m still adjusting it at this time, but it works like a dream for me~ lemme know if you have any questions~

edit: I did just remember, I have had “feat.” artists outside the main artist folder in a couple cases, but that’s only when there is no album artist/release.

also, if you’ve got artists with different scripts, it should sort them properly too, for example Hatsune Miku (in my library as “戝音ミク”) will be under H, not 1-9.

3 Likes

Thanks UltimateRiff. yep that will work for me, I added mine backwards and was the problem so I removed it

$if(            - %artist%
		%_multiartist%,
2 Likes

no problemo~ lemme know if you run into any issues!~