After audio tagging, save only certain fields

Hi, newbie here to Picard scripting. I’m mainly using the program to use acoustic printing to find original release year and record label names for various files, many of which I’ve ripped from compilations and box sets. The acoustic procedure sends me back pretty much what I want, but way too much. It seems cumbersome to manually only save ORIGINALYEAR and LABEL/PUBLISHER.

Can I make a simple script that will only write those two retrived fields with the new values?

Your answer will help me get a glimpse into Picard syntax and I can go from there.

Thanks much.

1 Like

Before trying this: give it a thorough testing on a variety of copies of your music!

You could use a script like this, that will prevent Picard writing these specific tags.
I believe the list is complete and correct, and contains all tags that Picard could write, but I am not 100% sure.
(maybe somebody could confirm)

Make sure to remove the entries from this list that you do want updated/written.
(and obviously: make sure that under Options > Tags you do not have ‘clear existing tags’ checked)


And did I mention that before trying this: give it a thorough testing on a variety of copies of your music?


Thanks, this was a good start. If nothing else, it shrinks the list of fields on the bottom of my screen. It looks like my long list of comma separated fields in the “preserve” line.

The advantage of this approach is:

A. You have a better overview and it’s easier to edit, turn on/off etc.
B. You could have a script running before this one that gets processed first and may use some of these tags to create a new tag. After that first script has done it’s work, this second one will make sure all original tags are left alone and not updated.

1 Like

Is this script redundant after having all those fields in the “preserve” list? Would you scan the file, retrieve the tags, then run the script, then save?

I’m pretty sure the ‘preserve’ list trumps the script. So if you have all these tags in the ‘preserve’ field already, the script won’t do anything.

If you have the checkbox for the script ticked, it will run automatically. If not, you can run it manually by using right-click on a release/recording.

Gotcha, thanks. Figuring out scripting and the Picard user interface has been… interesting, to use a euphemism. But I did learn some stuff here.

@hiccup, thanks for your great answer. Followup question: is it possible to use wildcards with $unset?

For example, $unset(musicbrainz_*) instead of listing each one.

I’m pretty sure it’s not possible to do that with regular tags as in your example.
For as far as I know it will only work on multi-value tags, such as as e.g. performer:*

nope, definitely not possible, seems to be confirmed by two guys who should know :wink: