Look how I create nice and neat file names for my pretty consistently tagged classical music Has to be dumped into a proper editor with syntax highlighting every time I rework it.
There's some interesting parts maybe for you and others, e.g. Track numbers in file names will have either 2 digits or if >99 tracks n digits (n=length of %totaltracks%) - Also, I make abbreviations of orchestra names and change "Anton Bruckner" to "Bruckner, Anton" .
May remove some crazy replacements because later I decided to use $ascii anyway.
$if(%INSERTFOLDER_FLAT%,$puts(iff,%INSERTFOLDER_FLAT%))$puts(spc,$strrchr(%composer%, ))$puts(comp_u,$if2(%artist_s%,%composer%))$if(%artist_s%,$puts(com,%artist_s%),$puts(com,$ascii($substr(%composer%,$add($get(spc),1),999)', '$left(%composer%,$get(spc)))))$puts(ttl,$trim($left($if2($meta(title),%work%),40)))$puts(wo,$trim($left($if2(%work%,%album%),40)))$if(%conductor%,$puts(con,$trim($substr(%conductor%,$strrchr(%conductor%, ),999))))$if(%performer%,$puts(per,$trim($substr(%performer%,$strrchr(%performer%, ),999))))$if($or(%ensemble%,%performer%),$puts(ens,$if2($upper($abbr(%ensemble%)),$get(per))))$if($and($get(con),$get(ens)),$puts(cens,'('$get(con) - $get(ens)')'),$if($or($get(con),$get(ens)),$puts(cens,'('$if2($get(con),$get(ens))')')))$if(%TOTALDISCS%,$puts(dscn,$num(%DISCNUMBER%,$len($num(%TOTALDISCS%,1)))))$if(%TOTALTRACKS%,$puts(trkn,$tracknumber($max(2,$len($num(%totaltracks%,1))))),$puts(trkn,$tracknumber(2)))$get(com)\[%INSERTFOLDER%\]$trim($replace($replace($replace($ascii($if2($get(iff),$get(wo)[ $get(cens)])\$if($get(iff),,[$get(dscn).]$get(trkn)'. ')$get(ttl)$if($get(iff),[ $get(cens)],)),'No. 0 ','No. 00 ','No. 1 ','No. 01 ','No. 2 ','No. 02 ','No. 3 ','No. 03 ','No. 4 ','No. 04 ','No. 5 ','No. 05 ','No. 6 ','No. 06 ','No. 7 ','No. 07 ','No. 8 ','No. 08 ','No. 9 ','No. 09 ','No. 0,','No. 00,','No. 1,','No. 01,','No. 2,','No. 02,','No. 3,','No. 03,','No. 4,','No. 04,','No. 5,','No. 05,','No. 6,','No. 06,','No. 7,','No. 07,','No. 8,','No. 08,','No. 9,','No. 09,'),'µ','mu','&',,'{','(','}',')','*',,'$','','#','',':','.','?',,'!','.','=','-','<',,'>',,'/',,'\\',,';',),' ',' ',' ',' '))
Example result:
..\Braga Santos, Joly\Symphony No. 04 (Cassuto - NSOOI)\03. II. Andante.m4a