Hello
I need to remove (or replace) all the ’ from the tags of all the songs I edit. I mean I need to remove all apostrophes or replace them with another character. Is it possible to do this in MusicBrainz?
You can add a script using the $replace
function to replace the apostrophes on the relevant tags. E.g. to replace the apostrophe with a normal single quote on the title tag:
$set(title,$replace(%title%,’,'))
A convenient way to do this on multiple tags would be to use the $foreach
function. Something like this to replace in the title
, artist
and albumartist
tag:
$foreach(title; artist; albumartist,
$set(%_loop_value%,$replace($get(%_loop_value%),’,'))
)
Thank you for the suggestion.
Sorry for asking stupid questions but this is my first time using this tool.
I added your script in the script editor and clicked Apply but it doesn’t seem to have changed anything.
What am I doing wrong?
You should probably be entering it as a tagging script rather than a file naming script. See the section in the docs under Scripting for a bit of an explanation of the differences between the two types.
Also scripts added in Options > Scripting will (if they are enabled) run when data gets loaded from MusicBrainz and usually are meant to manipulate the data loaded from MB in the right pane.
But you can also manually run them on your files via the context menu “Run scripts…”
thank you both, I finally realized that I had to enable tagger scripts first, now it works perfectly.
Is it possible to replace more than one character at a time?
Something like
$foreach(title; artist; albumartist,
$set(%_loop_value%,$replace($get(%_loop_value%),'/ò/à/ù,`/o/a/u))
)
where, in order, o replaces all ò, a replaces all à, etc.
You would need separate $replace calls for that.
I don’t know what your actual goal is, but maybe the “Non-ASCII Equivalents” plugin could help you. Again this only applies to data loaded on the right pane, but it would unaccent all characters at least on basic tags.