# \#scripting

**URL:** https://community.metabrainz.org/tag/scripting/172.md

[Latest](https://community.metabrainz.org/latest.md) · [Categories](https://community.metabrainz.org/categories.md) · [Tags](https://community.metabrainz.org/tags.md)

---

## [How to write a script to remove multiple tagging fields](https://community.metabrainz.org/t/how-to-write-a-script-to-remove-multiple-tagging-fields/815935)

<div class="topic-metadata">

**Author:** [@that-random-humanoid](https://community.metabrainz.org/u/that-random-humanoid)\
**Replies:** 1\
**Last updated:** [October 29, 2026, 11:14am UTC](https://community.metabrainz.org/t/how-to-write-a-script-to-remove-multiple-tagging-fields/815935 "2026-10-29T11:14:57Z")

</div>

So, I have been running into an issue with the tags applied by Picard, and how Musicbee decides to interpret them. Basically, Musicbee sees any instrumentalist, composer, writer, producer, etc. as a reasonable way to sor…

---

## [Determining whether condition applies to multiple files](https://community.metabrainz.org/t/determining-whether-condition-applies-to-multiple-files/505506)

<div class="topic-metadata">

**Author:** [@Deleted\_Editor\_2171912](https://community.metabrainz.org/u/Deleted_Editor_2171912)\
**Replies:** 13\
**Last updated:** [September 24, 2026, 4:18pm UTC](https://community.metabrainz.org/t/determining-whether-condition-applies-to-multiple-files/505506 "2026-09-24T16:18:52Z")

</div>

Hello, I’m trying to figure out whether it is possible to do the following with scripting: Determine whether a release consists of the same media type or not. For example, whether all of its discs are CDs, or if one i…

---

## [Scripting - how to set album artist only if tag is already empty/doesn't exist](https://community.metabrainz.org/t/scripting-how-to-set-album-artist-only-if-tag-is-already-empty-doesnt-exist/815484)

<div class="topic-metadata">

**Author:** [@rpbtz](https://community.metabrainz.org/u/rpbtz)\
**Replies:** 7\
**Last updated:** [August 18, 2026, 9:35am UTC](https://community.metabrainz.org/t/scripting-how-to-set-album-artist-only-if-tag-is-already-empty-doesnt-exist/815484 "2026-08-18T09:35:25Z")

</div>

Been banging my head against this for a good few hours now and figure it’s time to ask for help. I’m very new to Picard, but have been playing around with scripting over the past few days with some test files to get a ha…

---

## [Preserve specific tags only for specific track](https://community.metabrainz.org/t/preserve-specific-tags-only-for-specific-track/620869)

<div class="topic-metadata">

**Author:** [@Pianca82](https://community.metabrainz.org/u/Pianca82)\
**Replies:** 3\
**Last updated:** [August 3, 2026, 9:57am UTC](https://community.metabrainz.org/t/preserve-specific-tags-only-for-specific-track/620869 "2026-08-03T09:57:14Z")

</div>

Is it possible to preserve only one tag of a specific track? For example I want the track number 5 of the album “xy” not to be updated with the one in musicbrainz, but all the others of the album (or all the other album…

---

## [Issue With File Naming Script](https://community.metabrainz.org/t/issue-with-file-naming-script/814599)

<div class="topic-metadata">

**Author:** [@CDotJDotB](https://community.metabrainz.org/u/CDotJDotB)\
**Replies:** 7\
**Last updated:** [April 3, 2026, 10:32pm UTC](https://community.metabrainz.org/t/issue-with-file-naming-script/814599 "2026-04-03T22:32:01Z")

</div>

I have a few hundred country single tracks that I want segregated from my main library. I have set up a separate script to put them in a different folder. A lot of these albums have “Various Artists” as the album artist…

---

## [Issue With File Naming Script](https://community.metabrainz.org/t/issue-with-file-naming-script/814600)

<div class="topic-metadata">

**Author:** [@CDotJDotB](https://community.metabrainz.org/u/CDotJDotB)\
**Replies:** 0\
**Last updated:** [April 3, 2026, 2:14pm UTC](https://community.metabrainz.org/t/issue-with-file-naming-script/814600 "2026-04-03T14:14:03Z")

</div>

I have a few hundred country single tracks that I want segregated from my main library. I have set up a separate script to put them in a different folder. A lot of these albums have “Various Artists” as the album artist…

---

## [Edition‑Aware Naming Script for Picard](https://community.metabrainz.org/t/edition-aware-naming-script-for-picard/814455)

<div class="topic-metadata">

**Author:** [@MTBrain](https://community.metabrainz.org/u/MTBrain)\
**Replies:** 0\
**Last updated:** [March 17, 2026, 4:42pm UTC](https://community.metabrainz.org/t/edition-aware-naming-script-for-picard/814455 "2026-03-17T16:42:02Z")

</div>

Hi all, I’d like to share a Picard naming script I’ve been using to keep my music library clean and Plex/Lidarr‑friendly. It’s designed to: Build tidy artist‑letter and artist folders Create album folders in the f…

---

## [Picard Scripting Help Requests](https://community.metabrainz.org/t/picard-scripting-help-requests/549326)

<div class="topic-metadata">

**Author:** [@rdswift](https://community.metabrainz.org/u/rdswift)\
**Replies:** 26\
**Last updated:** [February 20, 2026, 11:19pm UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326 "2026-02-20T23:19:39Z")

</div>

This thread is a catch-all for requests to help with tagging and file naming scripts for MusicBrainz Picard. For example scripts that have already been developed, please refer to the thread: If you already have a sta…

---

## [Lyric file organisation/renaming script](https://community.metabrainz.org/t/lyric-file-organisation-renaming-script/813890)

<div class="topic-metadata">

**Author:** [@JadedBlueEyes](https://community.metabrainz.org/u/JadedBlueEyes)\
**Replies:** 0\
**Last updated:** [December 16, 2025, 12:27am UTC](https://community.metabrainz.org/t/lyric-file-organisation-renaming-script/813890 "2025-12-16T00:27:19Z")

</div>

I recently renamed my library to includethe truncated release ID - so moving from /Artist/Release/01. Track.flac to /Artist/Release \[mbid8\]/01 Track.flac. Unfortunately Picard deosn’t pick up and rename my lyrics files …

---

## [Simple Renaming Script](https://community.metabrainz.org/t/simple-renaming-script/813757)

<div class="topic-metadata">

**Author:** [@bt000](https://community.metabrainz.org/u/bt000)\
**Replies:** 1\
**Last updated:** [November 19, 2025, 3:55pm UTC](https://community.metabrainz.org/t/simple-renaming-script/813757 "2025-11-19T15:55:02Z")

</div>

Hi, I just installed picard, and the default renaming scripts do not seems to do what I would like. I browsed the forums, and there are so many posts with so many different scripts, I’m definitely out of my league here, …

---

## [Editing multi-value tags, replace only one occurrence](https://community.metabrainz.org/t/editing-multi-value-tags-replace-only-one-occurrence/813621)

<div class="topic-metadata">

**Author:** [@android](https://community.metabrainz.org/u/android)\
**Replies:** 1\
**Last updated:** [October 28, 2025, 3:40pm UTC](https://community.metabrainz.org/t/editing-multi-value-tags-replace-only-one-occurrence/813621 "2025-10-28T15:40:57Z")

</div>

Hello, I’m currently trying to modify the genre tag in my collection. I’ve used multiple genres for most of my MP3s and in many cases the last “genre” in the tag is actually the BPM. So for example one of my files has: A…

---

## [How can i use the original file value of a tag instead of the new Value in a script](https://community.metabrainz.org/t/how-can-i-use-the-original-file-value-of-a-tag-instead-of-the-new-value-in-a-script/784148)

<div class="topic-metadata">

**Author:** [@MiaYosh](https://community.metabrainz.org/u/MiaYosh)\
**Replies:** 19\
**Last updated:** [September 3, 2025, 5:26pm UTC](https://community.metabrainz.org/t/how-can-i-use-the-original-file-value-of-a-tag-instead-of-the-new-value-in-a-script/784148 "2025-09-03T17:26:00Z")

</div>

Hi, How can i use the original file value of a tag instead of the new Value in a script? %title% will get me switchinʼ Alive (Bee Gees vs. Will Smith), but is there some way to get the original value, in this case S…

---

## [Custom disambiguation when using a file naming script and missing comment tag?](https://community.metabrainz.org/t/custom-disambiguation-when-using-a-file-naming-script-and-missing-comment-tag/782230)

<div class="topic-metadata">

**Author:** [@musicalcarrot](https://community.metabrainz.org/u/musicalcarrot)\
**Replies:** 3\
**Last updated:** [August 12, 2025, 12:51pm UTC](https://community.metabrainz.org/t/custom-disambiguation-when-using-a-file-naming-script-and-missing-comment-tag/782230 "2025-08-12T12:51:50Z")

</div>

Up until now, I’ve been adding this sort of disambiguation to the Album title e.g. “You Are Here \[Special Edition\]”. But I don’t like doing that since that’s not actually the album title. I realise there is a disambigua…

---

## [How to set directories and name files for vinyl albums (and technically cassettes too) to include the album sides and correct vinyl numbering?](https://community.metabrainz.org/t/how-to-set-directories-and-name-files-for-vinyl-albums-and-technically-cassettes-too-to-include-the-album-sides-and-correct-vinyl-numbering/781951)

<div class="topic-metadata">

**Author:** [@musicalcarrot](https://community.metabrainz.org/u/musicalcarrot)\
**Replies:** 3\
**Last updated:** [August 10, 2025, 2:15pm UTC](https://community.metabrainz.org/t/how-to-set-directories-and-name-files-for-vinyl-albums-and-technically-cassettes-too-to-include-the-album-sides-and-correct-vinyl-numbering/781951 "2025-08-10T14:15:08Z")

</div>

Most of my music collection is CDs, second would be digital albums. But I do have a few vinyl records that have been digitised. I am using a heavily customised version of @rdswift ‘s file naming script and can handle CD…

---

## [Any way to shorten $in command with multiple search strings?](https://community.metabrainz.org/t/any-way-to-shorten-in-command-with-multiple-search-strings/779803)

<div class="topic-metadata">

**Author:** [@bishnubee](https://community.metabrainz.org/u/bishnubee)\
**Replies:** 3\
**Last updated:** [August 4, 2025, 11:48pm UTC](https://community.metabrainz.org/t/any-way-to-shorten-in-command-with-multiple-search-strings/779803 "2025-08-04T23:48:53Z")

</div>

Hi, I’m being picky and would like to make things cleaner, so I’m curious if there is a way to shorten the below? $if($or($in(%genre%,a),$in(%genre%,b),$in(%genre%,c),$in(%genre%,d)),do something) Sorry, it probably h…

---

## [Help understanding $rsearch()](https://community.metabrainz.org/t/help-understanding-rsearch/773497)

<div class="topic-metadata">

**Author:** [@FeloniousMonk13](https://community.metabrainz.org/u/FeloniousMonk13)\
**Replies:** 2\
**Last updated:** [July 20, 2025, 2:48am UTC](https://community.metabrainz.org/t/help-understanding-rsearch/773497 "2025-07-20T02:48:23Z")

</div>

I’m trying to make a tagger script that checks if the artist’s name starts with an article (The, A, or An) and delete the artistsort field if it’s not there. I tried to simplify it as much as possible, and I can’t figure…

---

## [Reissue types – deluxe, special, remaster, etc](https://community.metabrainz.org/t/reissue-types-deluxe-special-remaster-etc/760750)

<div class="topic-metadata">

**Author:** [@Internet-Elder](https://community.metabrainz.org/u/Internet-Elder)\
**Replies:** 3\
**Last updated:** [May 17, 2025, 4:29pm UTC](https://community.metabrainz.org/t/reissue-types-deluxe-special-remaster-etc/760750 "2025-05-17T16:29:59Z")

</div>

Hello all. This post is about those unique and modern (ie. not original) “reissue” albums: deluxe edition, special edition, collector’s edition, anniversary, remaster, remix, box set (and perhaps a couple more I’m overlo…

---

## [Scripting help for a noob please](https://community.metabrainz.org/t/scripting-help-for-a-noob-please/752406)

<div class="topic-metadata">

**Author:** [@steveyg777](https://community.metabrainz.org/u/steveyg777)\
**Replies:** 8\
**Last updated:** [April 4, 2025, 11:42pm UTC](https://community.metabrainz.org/t/scripting-help-for-a-noob-please/752406 "2025-04-04T23:42:03Z")

</div>

Hi there, everyone. I really don’t know much about scripts, but I want to set up a script so I can get on with fixing my library (about 3.3 TB so far). I tried to employ AI to help me create a script and the ‘oh so cock…

---

## [MB Picard v2.13.3 overwrites USLT even if the field is included in the list of tags to preserve](https://community.metabrainz.org/t/mb-picard-v2-13-3-overwrites-uslt-even-if-the-field-is-included-in-the-list-of-tags-to-preserve/751860)

<div class="topic-metadata">

**Author:** [@InvisibleMan78](https://community.metabrainz.org/u/InvisibleMan78)\
**Replies:** 3\
**Last updated:** [March 28, 2025, 3:23pm UTC](https://community.metabrainz.org/t/mb-picard-v2-13-3-overwrites-uslt-even-if-the-field-is-included-in-the-list-of-tags-to-preserve/751860 "2025-03-28T15:23:20Z")

</div>

I have added the field lyrics in the Options → Tags But my lyrics content will be saved as XXX||Lyrics from my song anyway. This is bad because I have set my lyrics with a language code like eng or deu (according the…

---

## [Specific reason why MB Picard writes Release Type in lowercase?](https://community.metabrainz.org/t/specific-reason-why-mb-picard-writes-release-type-in-lowercase/751629)

<div class="topic-metadata">

**Author:** [@InvisibleMan78](https://community.metabrainz.org/u/InvisibleMan78)\
**Replies:** 6\
**Last updated:** [March 28, 2025, 1:23pm UTC](https://community.metabrainz.org/t/specific-reason-why-mb-picard-writes-release-type-in-lowercase/751629 "2025-03-28T13:23:54Z")

</div>

I just detected that MB Picard writes the Release Type in all lowercase: where the website shows it as Is there a specific reason why this content is set to lowercase? Can I tell MB Picard not to do this conversio…

---

## [Help with file renaming script](https://community.metabrainz.org/t/help-with-file-renaming-script/746794)

<div class="topic-metadata">

**Author:** [@ruidito](https://community.metabrainz.org/u/ruidito)\
**Replies:** 4\
**Last updated:** [March 4, 2025, 12:06pm UTC](https://community.metabrainz.org/t/help-with-file-renaming-script/746794 "2025-03-04T12:06:23Z")

</div>

Hi everyone. Yesterday I made some posts on Reddit asking for help to tidy up and organize my entire flac music library (2 tb). Several people recommended Picard to me and here I am trying to learn how to use it. I want…

---

## [Chapterz: A script to help create chapters for M4B audiobooks](https://community.metabrainz.org/t/chapterz-a-script-to-help-create-chapters-for-m4b-audiobooks/738317)

<div class="topic-metadata">

**Author:** [@jwillikers](https://community.metabrainz.org/u/jwillikers)\
**Replies:** 0\
**Last updated:** [January 17, 2025, 10:22pm UTC](https://community.metabrainz.org/t/chapterz-a-script-to-help-create-chapters-for-m4b-audiobooks/738317 "2025-01-17T22:22:07Z")

</div>

I made a script to help me add chapters for M4B files in MusicBrainz. I’m calling it chapterz. It’s written in Nushell and available on GitHub here. It uses tone to extract the chapters from an M4B file and formats them …

---

## [Picard and ChatGPT](https://community.metabrainz.org/t/picard-and-chatgpt/720665)

<div class="topic-metadata">

**Author:** [@Internet-Elder](https://community.metabrainz.org/u/Internet-Elder)\
**Replies:** 3\
**Last updated:** [October 22, 2024, 5:10pm UTC](https://community.metabrainz.org/t/picard-and-chatgpt/720665 "2024-10-22T17:10:27Z")

</div>

Hi folks. After getting some scripting guidance from @rdswift and @aerozol the other day, I wondered if ChatGPT (which I very rarely use) would be fluent in Picard’s scripting language (since I’ve heard ChatGPT is good w…

---

## [Original date + deluxe / remaster date](https://community.metabrainz.org/t/original-date-deluxe-remaster-date/719407)

<div class="topic-metadata">

**Author:** [@Internet-Elder](https://community.metabrainz.org/u/Internet-Elder)\
**Replies:** 25\
**Last updated:** [October 23, 2024, 2:07pm UTC](https://community.metabrainz.org/t/original-date-deluxe-remaster-date/719407 "2024-10-23T14:07:36Z")

</div>

Hi everyone. Can the script below be optimized or improved at all? I’ll pose one specific case, but am happy to hear your ideas. The original goal was to include an album’s date at the front of its folder name, in squar…

---

## [$replacemulti and $cleanmulti don't provide expected result](https://community.metabrainz.org/t/replacemulti-and-cleanmulti-dont-provide-expected-result/715066)

<div class="topic-metadata">

**Author:** [@bishnubee](https://community.metabrainz.org/u/bishnubee)\
**Replies:** 3\
**Last updated:** [September 21, 2024, 12:01am UTC](https://community.metabrainz.org/t/replacemulti-and-cleanmulti-dont-provide-expected-result/715066 "2024-09-21T00:01:21Z")

</div>

Hi, I’m new to Picard. I’m trying to remove the ‘album’ value in %releasetype% when there is more than one value in that tag. %releasetype% =\> “album; compilation; broadcast” $replacemulti(%releasetype%,album,) =\> “c…

---

## [Use folder name in script](https://community.metabrainz.org/t/use-folder-name-in-script/524802)

<div class="topic-metadata">

**Author:** [@sjkiss](https://community.metabrainz.org/u/sjkiss)\
**Replies:** 9\
**Last updated:** [September 6, 2024, 2:58pm UTC](https://community.metabrainz.org/t/use-folder-name-in-script/524802 "2024-09-06T14:58:47Z")

</div>

HI there: is there a way to use the information in a folder or in a genre in a renaming script. Something like if the genre is classical, then do this? If a track is in this folder, do this? Thank you

---

## [Problem with $unset function](https://community.metabrainz.org/t/problem-with-unset-function/712431)

<div class="topic-metadata">

**Author:** [@Pianca82](https://community.metabrainz.org/u/Pianca82)\
**Replies:** 2\
**Last updated:** [September 3, 2024, 5:20pm UTC](https://community.metabrainz.org/t/problem-with-unset-function/712431 "2024-09-03T17:20:08Z")

</div>

I am using this script to preserve the content of some tags and it always works fine $foreach(%keep%,$unset(%\_loop\_value%)) I was creating another script but I noticed that if I try to copy one of the values contained …

---

## [Sum up numeric tags across multiple tracks](https://community.metabrainz.org/t/sum-up-numeric-tags-across-multiple-tracks/708433)

<div class="topic-metadata">

**Author:** [@Stig654321](https://community.metabrainz.org/u/Stig654321)\
**Replies:** 13\
**Last updated:** [August 19, 2024, 9:19pm UTC](https://community.metabrainz.org/t/sum-up-numeric-tags-across-multiple-tracks/708433 "2024-08-19T21:19:19Z")

</div>

Thank you for this plugin. I am trying to add the numeric values of a tag from the tracks of an album, but I can’t figure out the correct way to do that. Say an album consists of 4 tracks. They all have a tag named ‘…

---

## [Script to create an album genre from its various recording genres](https://community.metabrainz.org/t/script-to-create-an-album-genre-from-its-various-recording-genres/670548)

<div class="topic-metadata">

**Author:** [@ecomaniac](https://community.metabrainz.org/u/ecomaniac)\
**Replies:** 34\
**Last updated:** [August 5, 2024, 5:24pm UTC](https://community.metabrainz.org/t/script-to-create-an-album-genre-from-its-various-recording-genres/670548 "2024-08-05T17:24:29Z")

</div>

I’m trying to create a script to coalesce recording genres into a more general, short list of album genres. For genre sources, I’m using both the Musicbrainz & Wikidata’s servers. My setup options roughly follows @hicc…

---

## [New user Q - scripting for Plex - date sorting, and empty dates](https://community.metabrainz.org/t/new-user-q-scripting-for-plex-date-sorting-and-empty-dates/698477)

<div class="topic-metadata">

**Author:** [@Internet-Elder](https://community.metabrainz.org/u/Internet-Elder)\
**Replies:** 21\
**Last updated:** [June 5, 2024, 4:00pm UTC](https://community.metabrainz.org/t/new-user-q-scripting-for-plex-date-sorting-and-empty-dates/698477 "2024-06-05T16:00:04Z")

</div>

Hi folks. I’ve been wading into Picard for the first time, and have the very standard script you see below. My goal is to “unify” metadata and sorting of an already pretty tidy collection of music albums, for use in Plex…

[Next page](https://community.metabrainz.org/tag/scripting/172.md?match_all_tags=true&page=1&tags%5B%5D=scripting)
