Replacing any "/" with "⁄" strictly in file naming on Windows 10/11 (Help)

Hello All,

I have a feeling that it’s just not going to be compatible, but figured I’d ask here and see if anyone else has run into this issue and been able to work it out.

I’m trying to use some ASCII replacements only for filenames when required (essentially just illegal symbols for Windows). I’ve gotten most of them to work correctly.

I’m wanting to replace the / with the ⁄ in filenames but it’s not working it seems. All other substitutions I have in my filenaming script appear to be working well.

Below is my current script. I’ve been manually adjusting when I need to, but automating would be much nicer! Thanks in advance.

$set(_titleForFilename,$replace(%_titleForFilename%,/,/))
$set(_albumForFilename,$replace(%_albumForFilename%,/,/))
$set(_discsubtitleForFilename,$replace(%_discsubtitleForFilename%,/,/))
$set(_artistForFilename,$replace(%_artistForFilename%,/,/))
$set(_albumartistForFilename,$replace(%_albumartistForFilename%,/,/))
$set(title,$rreplace(%title%,/,⁄))
$set(album,$rreplace(%album%,/,⁄))
$set(_date,$if2(%originaldate%,%date%))
$set(title,$replace(%title%,...,…))
$set(album,$replace(%album%,...,…))
$set(title,$replace(%title%,:,∶))
$set(album,$replace(%album%,:,∶))
$set(title,$replace(%title%,*,∗))
$set(album,$replace(%album%,*,∗))
$set(title,$replace(%title%,?,?))
$set(album,$replace(%album%,?,?))
$set(title,$replace(%title%,",″))
$set(album,$replace(%album%,",″))
$set(title,$replace(%title%,\\,⧵))
$set(album,$replace(%album%,\\,⧵))
$set(title,$replace(%title%,|,ǀ))
$set(album,$replace(%album%,|,ǀ))
$set(title,$replace(%title%,<,‹))
$set(album,$replace(%album%,<,‹))
$set(title,$replace(%title%,>,›))
$set(album,$replace(%album%,>,›))

$if2(%albumartist%,%artist%)/
$upper($if($ne(%_secondaryreleasetype%,),%_secondaryreleasetype%,%_primaryreleasetype%))/
$if($ne(%albumartist%,),[$truncate(%_date%,4)] %album% [$truncate(%date%,4) %releasecountry% Release] [$if($ne(%catalognumber%,),%catalognumber%,N⁄A)]/,)
$if($gt(%totaldiscs%,9),%_paddeddiscnumber%-,)
$if($and($ne(%totaldiscs%,1),$lt(%totaldiscs%,10)),$num(%discnumber%,2)-,)
$if($gt(%totaltracks%,99),%_paddedtracknumber%. ,$num(%tracknumber%,2). )
$if(%_multiartist%,%artist% - ,)%title%

You can’t do that in a file naming script, because the variables passed to the file naming script already have the slashes replaced, so they do not get interpreted as directory separators.

What you can do as a workaround is already to the replacement inside a tagger script. You already seem to do this partially anyway, as I assume variables like %_titleForFilename% get initially defined in a tagger script. If you place:

$set(_titleForFilename,$replace(%_titleForFilename%,/,/))

also in the tagger script you can use %_titleForFilename% then in your naming script. Do the same for other tags you use in your naming, such as album and artist.

3 Likes

Thank you for this information. I thought sure I had it working before, but I tend to go between Linux based OS and then Windows and must have had it working on the Linux OS with Windows Compatibility off or something.

I haven’t tried this out just yet, but thank you soo much for showing a work around.