Thanks Leo, however I'm not sure that solves my problem, of having a button remove a single label - i.e. regardless of whether the label is there or not, force it to not be there.
This doesn't work, the label always ends up set:
// force label on
Properties SETLABEL=mylabel ADDLABEL
// toggle it off
Properties SETLABEL=mylabel SETLABELTOGGLE ADDLABEL
You could use a small amount of script code to check the current labels and then run the toggle command if the label is there, and do nothing if it isn't. I think that should work.
The way things are set up by default, you can usually only apply one label to files, and applying another replaces the old one. (You have to go out of your way for anything different.)
So you could search for files with the label you want to remove, then with the list of them, select-all, right-click, label > reset. No need for a script.
(This would also work with multiple labels, thinking about it, using the label-toggle command I posted above, since you wouldn't have to worry about turning on the label in any files if you'd already filtered out the ones without the label.)
I can set only one label? Mhh.. I seem to mix up the regular lables with label filters or with tags maybe, for which multiple can be applied. If there's only one regular label to be set, the script above does not seem to make much sense? I would be able to clear the single label with Properties SETLABEL=!reset and be fine?
By default. You can edit all the toolbar/menu commands involving labels to allow them to set more than one, but the default is there's just (at most) one label per file. (Plus a status icon, if any. Status icons are technically labels, but the default toolbars/menus treat them as separate things.)
Yes, as long as you've only selected files with the label you want to clear.
This might be better, to avoid clearing status icons as well:
Okay, to wrap up..
The default "Properties -> SetLabel" menu only allows to set one label.
The command Properties SETLABEL=Green,Blue,etc.. would allow to set multiple labels.
Now the script makes sense again and I think we're back to start, some kind of "REMOVE" option would be nice for the Properties command. Thank you for refreshing some of my brain cells.. o)
No, it won't do that unless you include ADDLABEL. From near the top of this thread:
(As a historical note, you could not initially have more than one label per file. This is why the commands work that way by default. The ADDLABEL switch was added later when it became possible to have more than one label on the same file.)
If you explicitly specify multiple labels like Properties SETLABEL=Green,Blue then yes, I think it will set both those labels. But it will also clear all other labels unless you include ADDLABEL.