Tagger Script Doesn't Seem to Do Anything


I’m having an issue where no matter what I put in my “Tagger Script”, it has no effect when I click “Save” on a file.

My situation is that I have some single tracks ripped from albums that I don’t want associated with those albums, so I figured if I set a track number of 0 for those, and then add a tagger script to remove all abum-related tags, I will be golden. I still wanted all the other info like albumart and composer, etc. saved in the tags. This is what I put in my tagger script:

$if($eq(%tracknumber%,0), $unset(album) $unset(albumartist) $unset(tracknumber) $unset(discnumber) $unset(totaltracks) $unset(totaldiscs))

So I loaded up a sample track, used lookup to find all its info, and when it did, I changed its tracknumber tag in Picard to 0 on the right side. Then clicked ‘Save’, but my tagger script didn’t run (yes, it’s checked on in the advanced options) because all of the album info was still written into the tags. I kept fighting with the tagger script until all it had was this:


And still when I click “Save” on a track, it doesn’t actually set the artist tag to “TEST”. I must be misunderstanding something, but I don’t know where I’m going wrong. Can someone help?

After more playing around with the tagger scripts, I now understand what my misconception about how the tagger scripts was. The scripts are applied to TAGS COMING IN FROM MB. So it doesn’t care that I manually set the track # to 0.

Now my question is, how can I craft an $if() statement to catch cases where when I look up data for a track, but only have 1-2 tracks from the looked-up albums. Anyone know?

1 Like

I had a plugin for personal use which can make any track behave like it is a non-album track. The problem with the plugin was that it relies on some code that was not in Picard at the time. But I think it should work with the latest release. I will take a look tomorrow (please ping me if I forget). But I think this would cover your use case quite well if it works.

Thanks, I’ve actually got a bit further now - I’m catching the case where I have “incomplete” albums using

$lt($matchedtracks( ),%_totalalbumtracks%)

My current problem is that I can’t figure out how to set a particular tag to nothing (i.e. clear the tag) - $unset(album) doesn’t work, and neither does $set(album,).

Ok, I dug out the plugin called “loadasnat”. It has been lying around for a year, but luckily it just works with Picard 1.4 without changes. I have requested inclusion of this plugin into the official Picard plugins list, but for now you can just download loadasnat.py and save that file to your Picards plugin folder.

The plugin is used by right clicking on any track loaded in the right pane and select “Plugins > Load as non-album track…”. This will load the track as if it was a non-album track, move all files matched to this track over and remove the tags that are album specific.

Please let me know how this works for you, especially the tag removal part. I likely have forgotten something here :slight_smile: Currently the following tags get removed:

  • albumartist
  • albumartistsort
  • albumsort
  • asin
  • barcode
  • catalognumber
  • discnumber
  • discsubtitle
  • media
  • musicbrainz_albumartistid
  • musicbrainz_albumid
  • musicbrainz_discid
  • musicbrainz_releasegroupid
  • releasecountry
  • releasestatus
  • releasetype
  • totaldiscs
  • totaltracks
  • tracknumber

Update: I just added another 3 tags to the removal list, so maybe this is now actually complete :wink: