Adding tags with a space with scripting

Tags: #<Tag:0x00007f7573d8ce18>

Picard writes the album artist to the tag %albumartist%, but for mp3 files foobar2000 seems to only read Album Artist, so I want to copy the value over to a new tag %album artist% (preferably only for mp3 files, like with $if($eq(_extension,mp3),$copy(%Album Artist%,albumartist),). But when I enter that, Picard complains about the unexpected space, and I can’t escape it with a \ either. Am I doing something wrong or is this a limitation in Picard?

The copy-function needs the pure tag names without enclosing %:

$copy(Album Artist,albumartist)

Edit: I only tested the script above, the following version from my original answer did not what it should have, see my next post.

$if($eq(_extension,mp3),$copy(Album Artist,albumartist),)
2 Likes

Thank you, I always get the thing with the % wrong. It isn’t working completely yet, however: the check for the extension doesn’t work for some reason. I tried with and without %, with .mp3 and simply mp3. Can you also help me with that?

For $eq you also want to use %'s. However I was just playing around and couldn’t get half the variables to work. Like this worked:
$set(album,%album% \(%_releasecomment%\))
But this did not:
$set(album,%album% \(%_extension%\))

That seems a fairly straightforward test, but maybe I’m missing something. Perhaps this is a bug.

I believe it will work when you run that script manually after the tracks have been loaded in the right panel.

2 Likes

Sorry, during my first attempt I focused on the main issue with the space and did not test the whole script line :sweat_smile:
Now I did that and the following works for me, the additional tag appears for *.mp3 files after executing the script (but not for MP3 files with a different extension):

$if($eq(%_extension%,mp3),$copy(Album Artist,albumartist))

Wrapping %_extension% was the only thing I needed to change, the second comma of the if-clause is optional and has no effect.

2 Likes

Thank you! Do you (or anyone else) know why it doesn’t work automatically, even if I have the script ticked in the settings. Is that a bug?

The scripts are applied at time of loading the release, but _extension is a file variable which is not available at that point in time.

There is an outstanding feature request for having the scripting applied at time of files getting matched to the release.

3 Likes