Help with Picard tagger script

That’s actually not as easy as using $replace in the naming script. The slash / is a special character that is used as a folder separator in the naming script. To prevent that a slash in any variable is treated as a folder separator it gets replaced in all variables before the scripting is actually executed. That means if you have %artist% set to AC/DC it will be converted to AC_DC before being processed by the script. If that would not happen you would end up with a folder hierarchy of AC > DC. But that also means you can’t use $replace in the renaming script to change it.

If you want to replace / with any other character, e.g. |, you will need to do this before the renaming script is applied. If you set the following script in Options > Advanced > Scripting it will replace any slash in the %artist% variable accordingly:

$set(artist,$replace(%artist%,/,|))

That will of course have the downside that it will also replace the / character in the tags. To fix that don’t change the %artist% variable itself but create a new one, e.g. %_artist%:

$set(_artist,$replace(%artist%,/,|))

The leading underscore in the variable name makes this a hidden variable, that will not be written to the tags. But you can use it in your renaming script (just use %_artist% instead of %artist%). If you do this for every variable you use in the renaming script you will have the result you wanted.

2 Likes