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

hiccup

  • Hero Member
  • *****
  • Posts: 9124
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: 9124
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: 5228
@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: 5228
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: Today at 09:41:15 AM by boroda