Author Topic: MusicBee functions for virtual tags cheatsheet  (Read 51471 times)

hiccup

  • Hero Member
  • *****
  • Posts: 9133
I have read and re-read this more times than I can count.
Same here ;-)

Quote
I did though run across a small typo.
Thanks, it's corrected.

hiccup

  • Hero Member
  • *****
  • Posts: 9133
updated

I have added some info on how to use virtual tag code/formulas in the Additional Tagging and Reporting Tools plugin.
(see here)

@boroda
Please let me know if you think the inforrmation and example I gave could be improved upon?

Also, your help/readme says that semi-colons also need to be doubled.
Is that correct? Doubling those failed for me in (briefly) testing this.

boroda

  • Hero Member
  • *****
  • Posts: 5250
@boroda
Please let me know if you think the inforrmation and example I gave could be improved upon?

Also, your help/readme says that semi-colons also need to be doubled.
Is that correct? Doubling those failed for me in (briefly) testing this.

thanks pointing that out. semicolons and square brackets must be doubled only if they are parts of ASR function, but not if they are the parts of VT expression inside \@eval[[...]], i.e semicolons must be doubled in \@tc[[<Title>;;a the an]], but not in e.g. \@eval[[$Replace(<Genre>,,"";"",,"",,"")]]

boroda

  • Hero Member
  • *****
  • Posts: 5250
updated

I have added some info on how to use virtual tag code/formulas in the Additional Tagging and Reporting Tools plugin.
(see here)

@boroda
Please let me know if you think the inforrmation and example I gave could be improved upon?

@hiccup, some corrections:

Quote
or ASR presets, it is possible to integrate 'virtual tag' code.
(in the 'replace with:' field)

This can be accomplished using AT&RT's 'eval' function.
In principle, the syntax for 'eval' is: \@eval[…] \@eval[[...]]
(the ellipsis indicating where to put your formula)

But, for it to work, the following characters need to always be doubled:
, (commas) - only if they are part of VT expression, not parameters
" (double quotes) - only if they are part of VT expression, not parameters quotes can't be parameters!
[ ] (square brackets) not inside \@eval[[...]], but around VT expression only, e.g. \@eval[[$Replace(<Genre>,,""["",,"","")]] - note single square bracket and single comma because they are arguments, not parts of VT expression

So if the code for a virtual tag is something like:
$Replace(<Genre>,;,",")

You'll need to change it to this to make it work in AT&RT:
\@eval[[$Replace(<Genre>,,;,,"",,]"")]] - \@eval[[$Replace(<Genre>,,;,,"","")]] - single comma between quotes because it's parameter!

square brackets can't be part of VT syntax, so they never must be doubled inside \@eval[[...]], quotes and commas must be doubled if they are parts of VT syntax, not parameters

important note: replacement step is always skipped if there is no match in the search pattern. if you want to address tags directly in replacement step (e.g. <Artist> instead of $1, $2, etc.), then just search any tag for ^.* to always match this step and never skip \@eval[[...]] in replacement.
Last Edit: June 20, 2025, 09:41:15 AM by boroda



boroda

  • Hero Member
  • *****
  • Posts: 5250
@hiccup, please correct descriptions of $SentenceCse() and $TitleCase() VT functions: to omit any parameter in the middle of parameter list in MB native VT editor you can not only use ` , but also two commas in a row ,,

MB VT editor will add "" instead of empty parameter automatically, this will work too, and this always worked.

p.s. to omit the end parameter(s) just type closing parenthesis earlier.

hiccup

  • Hero Member
  • *****
  • Posts: 9133
@hiccup, please correct descriptions of $SentenceCse() and $TitleCase() VT functions: to omit any parameter in the middle of parameter list in MB native VT editor you can not only use ` , but also two commas in a row ,,
p.s. to omit the end parameter(s) just type closing parenthesis earlier.
I'm a bit reluctant about this one to be honest.
I would prefer to keep things as concise and brief as possible for that page.
And both functions already mention: "See the AT&RT help file for details on how to use additional parameters."
That shouldn't be too much of an effort for users that want to use these functions?

I'll think about it, and maybe I will change my mind later.
Or if you insist, I will do it.

boroda

  • Hero Member
  • *****
  • Posts: 5250
no, i don't insist. it was more a remark, then a wish