Repository for neat file name string patterns and tagger script snippets

This is my Frankenstein-d very in progress system but I am posting it because I wanted something that would take the tag/genre musical or soundtrack and put it in it’s own folder, not sorted by artist name. Feel free to steal or change! This should be pretty beginner friendly as far as the sorting out folders go.

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

$if($in(%totaltracks%,01), $set(Album1,Singles/))
$if($in(%totaltracks%,01), $set(Track1,%noop%/))


$if($eq($lower(%genre%),soundtrack), $set(Artist1,Sountrack/))
$if($in(%album%,Soundtrack), $set(MainFolder1,Sountrack/))
$if($in(%album%,Soundtrack), $set(Artist1,Sountrack/))
$if($in(%itle%,soundtrack), $set(Mainfolder1,Sountrack/))

$if($eq($lower(%genre%),musical), $set(Artist1,Musical/))
$if($eq($lower(%genre%),musical), $set(Mainfolder1,Musical/))
$if($eq($lower(%genre%),musical), $set(Artist1,%noop%/))
$if($eq($lower(%genre%),musical), $set(MainFolder1,Musical/))


%MainFolder1%
%Artist1%
%Album1%
%MultiDisc1%
%PreTitle2%
%Track1%
%Title%

Hello, I’d like to write a naming script where certain release info is included in the folder name, but only if its available and I only want separators if they’re available. I thought this was doable with the $join function, but it doesn’t seem to work as I imagine. Here is my current naming script:

$if2(%albumartist%,%artist%)
/ $if(%date%,[%date%] ,)
$if(%albumartist%,%album% [$if(%media%,%media% - ,)$if(%label%,%label% - ,)$if(%catalognumber%,%catalognumber% - ,)$if(%barcode%,%barcode%)]/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)- %artist% - %title%

I thought replacing the items in the bracket with this would work, but it hasn’t:

$if2(%albumartist%,%artist%)
/ $if(%date%,[%date%] ,)
$if(%albumartist%,%album% [$join($if(%media%,%media%,)$if(%label%,%label%,)$if(%catalognumber%,%catalognumber%,)$if(%barcode%,%barcode%), - )]/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)- %artist% - %title%

The intended result would be like this for the album folder when it lacks parts of the release info:

[2026-09-11] Passed Oceans [Digital Media - Passed Recordings]

and like this when it has it:

[2000-06-01] Fresh Produce [CD - Ntone - NTONE CD 39 - 625978203927]

I would appreciate some help to fix this script. Thank you

Okay, a little embarrassing to have seemingly found the solution right after sharing, but I believe this is working as intended:

$setmulti(releaseinfo,%media%;%label%;%catalognumber%;%barcode%,;)
$cleanmulti(releaseinfo)

$if2(%albumartist%,%artist%)
/ $if(%date%,[%date%] ,)
$if(%albumartist%,%album% {$join(%releaseinfo%, -,;)}/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)- %artist% - %title%
1 Like