How to retrieve local file tags for scripting?

I’m probably not at my brightest, so bare with me please:

In a script I want to retrieve the ‘album artist’ tag that is already present in the file(s).
When e.g. using %albumartist% it will retrieve the data form MB’s database.
But I want to use the information that is already in the file(s).

How can I make the script use the local file tags?

I know this wasn’t possible in older Picard versions, but if I am not mistaken this should be possible these days?

No, you currently cannot in a script decide whether you access the file data or the MB data. What you have access to is tags from the file that does not get overwritten with data from the track. Basically you have access to the data as you see it on the new value column for the metadata.

2 Likes

I can’t get this working as I would like.
Example:

I have a simple script that calculates the length of [Album Artist]
I have Picard set to ‘clear tags’, but I have excluded [Album Artist] from it. (preserve tags)

When I load the release for the very first time, the Album Artist as retrieved from MusicBrainz is very long and counts 201 characters.

Then I change the Album Artist to a shorter name that contains 24 characters.
Running the script gives the updated result of 24.

But when I restart Picard (or reload the release), while Album Artist will still show the correct new shorter name, the character count of the longer name that MusicBrainz has in it’s database for it will be displayed.

Is there a way to make scripts like this using the local file tag?