I have 2 labels named « Red » and « Bold ».
I want to create a toggle button in toolbar to add/clear labels to files but failed.
Properties SETLABEL=Red,Bold ADDLABEL SETLABELTOGGLE
What’s wrong?
I have 2 labels named « Red » and « Bold ».
I want to create a toggle button in toolbar to add/clear labels to files but failed.
Properties SETLABEL=Red,Bold ADDLABEL SETLABELTOGGLE
What’s wrong?
Properties SETLABEL=Red,Bold on its own does nothing, which tells us SETLABEL does not accept multiple labels like that, at least in its current form. It is probably trying to set a label called "Red,Bold".
(Nothing in the documentation says that should work either, so I don't think it is a bug.)
I think scripts can query labels now so a script could be written to toggle a pair of labels as a single thing, assuming you want them either both on or both off. (To literally toggle both independently should not need a script.)
After searching through the Opus 12 beta release notes:
...The Properties SETLABEL command now accepts multiple values, to apply one or more labels to a file at once (e.g. Properties SETLABEL red green ...
Properties SETLABEL Red Bold SETLABELTOGGLE seems to work.
Excellent
So if we have Properties SETLABEL=Red then add label with the argument Template (menu), command is formated like Properties SETLABEL=Red,Bold. No need comma.
Before that, I try command bellow but only Bold label is set. Why?
Properties SETLABEL Red
Properties ADDLABEL SETLABEL Bold
We've made Properties SETLABEL=Red,Bold work in the next beta. (The old syntax will still work as well.)