# Picard Scripting Help Requests

**URL:** <https://community.metabrainz.org/t/picard-scripting-help-requests/549326>\
**Category:** MusicBrainz Picard\
**Tags:** scripting\
**Created:** [September 2, 2021, 7:57pm UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326 "2021-09-02T19:57:29Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)\
**Post date:** [October 7, 2024, 12:35pm UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326/21 "2024-10-07T12:35:15Z")

</div>

```taggerscript
$if($lt(%originaldate%,%date%),$set(alert,TRUE),$set(alert,FALSE))

```

This gives FALSE to me if originaldate is 1955 and date is 1953. Can you share the full script?

---

<div class="post-metadata">

**Author:** ![psychoadept](https://community.metabrainz.org/user_avatar/community.metabrainz.org/psychoadept/32/204_2.png) [@psychoadept](https://community.metabrainz.org/u/psychoadept)\
**Post date:** [October 7, 2024, 12:57pm UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326/22 "2024-10-07T12:57:55Z")

</div>

I don’t have anything that touches dates except the four lines above. There’s an $if that runs only on .m4a files, but it gets rid of originaldate completely, so that’s not in effect here.

I have originaldate listed under “Preserve these tags” if that matters. It gets added if blank, but otherwise it keeps the value in the file.

Update: sorry, I muddied the waters. I had the values backwards, above. $eq returns TRUE and the others return FALSE. That makes sense if the script is checking the “real” value and not the value in the file. AHA.

So false alarm on the script problem. I was gonna be surprised if I’d found a problem like that which no one else had.

---

<div class="post-metadata">

**Author:** ![mcknightenham](https://community.metabrainz.org/user_avatar/community.metabrainz.org/mcknightenham/32/88887_2.png) [@mcknightenham](https://community.metabrainz.org/u/mcknightenham)\
**Post date:** [November 30, 2024, 9:00pm UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326/23 "2024-11-30T21:00:02Z")

</div>

Hi all,  
Trying to remove variations of official music video or just official audio/video from song titles. Any opening “(” encountered is not removed from the title and I am very new to regex so any help would be greatly appreciated!

````taggerscript
$set(title,$rreplace(%title%,\\\([Oo][Ff][Ff][Ii][Cc][Ii][Aa][Ll]\(?:\\s*[mM][uU][sS][iI][cC]\)?\\s*[Vv][Ii][Dd][Ee][Oo]|\(?:[Oo][Ff][Ff][Ii][Cc][Ii]?[Aa][Ll]\\s*\(?:[aA][Uu][Dd][Ii][Oo]|[vV][Ii][Dd][Ee][Oo]\)\)?\\\),))```

edit: it seems the snippet works as intended, the opening "(" is remains for text wrapped inside parentheses that is not "official music video" or "official audio" or "official video"
````

---

<div class="post-metadata">

**Author:** ![mcknightenham](https://community.metabrainz.org/user_avatar/community.metabrainz.org/mcknightenham/32/88887_2.png) [@mcknightenham](https://community.metabrainz.org/u/mcknightenham)\
**Post date:** [January 22, 2025, 7:27am UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326/24 "2025-01-22T07:27:55Z")

</div>

I am trying to append a genre if the genre isn’t already contained inside %genre% the current snippet I have will append the genre whether it is inside or not. What am I doing wrong?

````taggerscript
$if($not($in($getmulti(%genre%,-1), Lo-Fi)),$setmulti(genre,%genre%; Lo-Fi),)```
````

---

<div class="post-metadata">

**Author:** ![rdswift](https://community.metabrainz.org/user_avatar/community.metabrainz.org/rdswift/32/7032_2.png) [@rdswift](https://community.metabrainz.org/u/rdswift)\
**Post date:** [January 22, 2025, 2:10pm UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326/25 "2025-01-22T14:10:34Z")

</div>

Try removing the space before “Lo-Fi” in your check and try using `$inmulti()` so that the line looks like:

```taggerscript
$if($inmulti(%genre%,Lo-Fi),,$setmulti(genre,%genre%; Lo-Fi))

```

---

<div class="post-metadata">

**Author:** ![FeloniousMonk13](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/f/3ab097/32.png) [@FeloniousMonk13](https://community.metabrainz.org/u/FeloniousMonk13)\
**Post date:** [February 20, 2026, 7:03pm UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326/26 "2026-02-20T19:03:18Z")

</div>

Is it possible to add line breaks to scripts to make them easier to read?

---

<div class="post-metadata">

**Author:** ![rdswift](https://community.metabrainz.org/user_avatar/community.metabrainz.org/rdswift/32/7032_2.png) [@rdswift](https://community.metabrainz.org/u/rdswift)\
**Post date:** [February 20, 2026, 11:19pm UTC](https://community.metabrainz.org/t/picard-scripting-help-requests/549326/27 "2026-02-20T23:19:39Z")

</div>

The answer to that is… sometimes.

It really depends on the type of script (tagging or file naming) and where the breaks are entered. For example, you need to be careful not to break the lines such that values used for comparisons, tests or assignments are accidentally altered. Generally, breaking lines between true and false sections of things like `$if()` are safe, unless the result is fed to another comparison or `$if()` command. You might have to experiment to see if the added line breaks (and indenting) have an undesired impact on the output.

Some things like `$set()` and `$setmulti()` are pretty much always safe to start on a new line (even indented).

[Previous page](https://community.metabrainz.org/t/picard-scripting-help-requests/549326.md?page=1)
