Author Topic: Buttons with scripts in MB language  (Read 1421 times)

Fox63

  • Full Member
  • ***
  • Posts: 135
Currently scripts can only be used in virtual fields.
It would be nice if scripts could be used as functions to be associated with buttons.
You could edit tags without using virtuals.
1) change the color of a text based on a comparison.
2) delete text again based on a comparison.
3) add text to a tag
4) copy part of a tag to one that already exists
I think that as examples would suffice, but so much more could be done.


Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
It would be nice if scripts could be used as functions to be associated with buttons.
I believe this can already be done with the Additional Tagging & Reporting Tools plugin. If you don't have it installed already, please do, and then:
search for "presets" within that plugin's thread as it would be a good starting point to learn how to customize them to suit your needs.

Any preset-related questions would need to be posted in that thread in order for the developer to see them and offer insight where required.
Strength and Honour (2025)

Fox63

  • Full Member
  • ***
  • Posts: 135
It would be nice if scripts could be used as functions to be associated with buttons.
I believe this can already be done with the Additional Tagging & Reporting Tools plugin. If you don't have it installed already, please do, and then:
search for "presets" within that plugin's thread as it would be a good starting point to learn how to customize them to suit your needs.

Any preset-related questions would need to be posted in that thread in order for the developer to see them and offer insight where required.

Hi
I used "advanced search & replace" which is the only one that can do operations even between different tags with conditions. Unfortunately, not knowing English, and especially regex, it is very complicated for me.
Using the language already in MB but associated with a button that then generates a loop between all the tracks seems much easier to me than having to learn a language from scratch.
By the way, MB's language is so simple that with a little practice you can really do a lot of routines.

Translated with DeepL.com (free version)

Zak

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2553
Currently scripts can only be used in virtual fields.
It would be nice if scripts could be used as functions to be associated with buttons.
You could edit tags without using virtuals.
Virtual Tags are only used for specifying what is displayed on-screen, so I'm not sure how that would work for editing values.

To address your numbered examples:

1) change the color of a text based on a comparison.
This seems out of place, as it is unrelated to tagging or buttons.
However, MusicBee supports these custom Markup functions in Virtual Tags:



2) delete text again based on a comparison.
3) add text to a tag
4) copy part of a tag to one that already exists

Based on these other suggestions and your apparent willingness to learn simple scripting commands, it sounds like you should add Mp3tag to your workflow:

https://www.mp3tag.de/en/index.html

Using the language already in MB but associated with a button that then generates a loop between all the tracks seems much easier to me than having to learn a language from scratch.
By the way, MB's language is so simple that with a little practice you can really do a lot of routines.

You will have to learn Mp3tag's own built-in scripting commands, but they're well-documented and not unlike MusicBee's virtual tag functions so it isn't too hard.

https://docs.mp3tag.de/scripting

e.g.
Code
$Left(%TagName%, 3)
$If($Eql(%Artist%,The Beatles),English,Not English))
You can combine any number of separate commands to build up a library of custom tagging Actions to tag your files quickly and consistently.
Bee excellent to each other...

Fox63

  • Full Member
  • ***
  • Posts: 135
I didn't understand how to insert scripts.
I hope you can operate on the virtual tags as well because from what I've seen it doesn't look like it.
I will see if I can find info on the web.
Thanks

boroda

  • Hero Member
  • *****
  • Posts: 5250
ASR of tag tools plugin has \@eval[[virtual tag expression]] function (it can be used in "replace by" fields only). you can define one or more ASR presets, which use only one step to search for ^(.*) in given tag and replace by e.g. \@eval[[\@1]], where \@1 means <custom text 1>. also, you can assign hotkey/toolbar button to any ASR preset to quickly apply it to selected tracks. you must refer searched tag as $1 in <custom text 1>.