Turning Status Label OFF

Hi!

I use Properties SETLABEL=status1 ADDLABEL a lot, also with the SETLABELTOGGLE argument.
I cant find a way to only remove the specified label.
If i have 5 files selected, all has "status1", and 2 of them have "status2" label, i have no ability to remove all "status2" labels in 1 buttonpress while keeping all 5 files selected. Or do i?
For example i have 50 files, with some of them having multiple labels, and i would like to select all, press a button to remove only "watch later" labels because i know i watched them all. Something like a REMOVELABEL argument would be very useful.

Thank you in advance for ideas or suggestions!

Have you tried Properties SETLABEL=!reset?

Removes the label from all selected items. You can combine this with the LABELCATEGORY argument to only remove labels in certain categories.

Properties

Thanks for the suggestion, this could be viable, but i would need to create a single category for every label i need to use which takes away the intention of categories. I just thought we could have a command to remove named label since we can remove named category.
Thank you though!

Hi @tortilladude :slightly_smiling_face: I think this is the syntax you're looking for:

Properties SETLABEL "watch later" !reset

This will reset (remove) only the "watch later" label from the selected files and folders, and leave other labels untouched.

Edit: The suggestion from @lxp is correct also, but it vill generate a list of all your labels, from where you can choose which label (on chosen files and folders) is to be affected by the '!reset' switch.

Hi! Thx for the suggestion but this does not work for me. The label "test" is given to 5 files and running this command: Properties SETLABEL "test" !reset does not remove any labels. SETLABEL needs a "=" after it i think. And if i do this: Properties SETLABEL="test",!reset then all labels are removed from the files.

Oops, I shouldn't just have relied on my memory :man_facepalming:...... This is the correct one (and now tested and confirmed :white_check_mark: on my own install) :

Properties SETLABEL="Test label" ADDLABEL SETLABELTOGGLE

And I hereby swear to never again post anything on this forum, without double-checking my facts :sunglasses:

That will toggle the label, which is slightly different to removing the label. (e.g. If you want to select-all and not worry about which files do or don't have the label, removing it from all files, without modifying any other labels.)

I'm not sure if there currently is a way to strictly remove just one label (without using categories and without affecting other labels).

If could be done using a script which filtered the list of files to only include those which already have the label, then ran the toggle command. But there should probably be a proper argument to do it, now that it has come up.

Thank you for confirming! I can live with this, i created separate categories for my most important Statuses and it works. If in the future you implement the remove argument then my Label properties will look prettier :slight_smile:
Thank you everyone for the comments!

Yes, @Leo is of course right - dunno where my head was :upside_down_face:....

But, after scratching it (my head, that is), I think I've come up with with a neat little solution (and the only one I can think of without using script),

By making sure that no files without the label in question will be affected or modified, we can make safe use of SETLABELTOGGLE - and for that to happen, we only need to set up a little filter targeted for that particular label. So, go to Preferences->File Operations->Filters, and set up this little filter:

image

Note: In this example, MyLabel is the label, and Match_MyLabel is the filter we've just created and saved.

The command:

@disablenosel

@keydown:none
  Properties SETLABEL=MyLabel ADDLABEL
@keydown:shift
  Select PATTERN=Match_MyLabel FILTER FILTERFLAGS=deselect 
  Properties SETLABEL=MyLabel SETLABELTOGGLE ADDLABEL
@keydown:common

With the @keydown command modifiers we'll in practice have a double button, which in normal modus operandi (that is, with no keys pressed) just sets the label to any file or folder selected, unless they already has that label. And with ADDLABEL, this happens without affecting other labels connected to the files.

Then, if the command is being run with the SHIFT key pressed down, Select will use the filter on all selected files and folders, and simply deselect all of those which do not have the label set, before toggling off the label from the remaining files and folders as normal.. :slight_smile:

You can try this:

Properties SETLABEL="测试标签" SETLABELTOGGLE ADDLABEL

It can toggle only a single label, while leaving any other labels the file has alone.

2 Likes

Great work! Imitation is the sincerest form of flattery. Here is a three button which shows how to have a series of label on/off settings.

<?xml version="1.0"?>
<button backcol="none" display="icon" icon_size="large" label_pos="right" textcol="none" type="three_button">
	<label>Aliases/Lebels</label>
	<icon1>#setcolor</icon1>
	<button backcol="none" display="label" icon_size="large" label_pos="right" textcol="none" type="three_button">
		<label>Set Red Label</label>
		<icon1>#newmenu</icon1>
		<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
			<label>On</label>
			<icon1>#setcolor</icon1>
			<function type="normal">
				<instruction>@toggle:disable</instruction>
				<instruction>@disablenosel</instruction>
				<instruction>//@keydown:none</instruction>
				<instruction>  Properties SETLABEL=Red SETLABELTOGGLE ADDLABEL</instruction>
				<instruction>//@keydown:shift</instruction>
				<instruction>//  Select PATTERN=Match_Red FILTER FILTERFLAGS=deselect </instruction>
				<instruction>//  Properties SETLABEL=Red SETLABELTOGGLE ADDLABEL</instruction>
				<instruction>//@keydown:common</instruction>
			</function>
		</button>
		<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
			<label>Off</label>
			<icon1>#setcolor</icon1>
			<function type="normal">
				<instruction>@toggle:disable</instruction>
				<instruction>@disablenosel</instruction>
				<instruction>//@keydown:none</instruction>
				<instruction>//  Properties SETLABEL=Red SETLABELTOGGLE ADDLABEL</instruction>
				<instruction>//@keydown:shift</instruction>
				<instruction>  Select PATTERN=Match_Red FILTER FILTERFLAGS=deselect </instruction>
				<instruction>  Properties SETLABEL=Red SETLABELTOGGLE ADDLABEL</instruction>
				<instruction>//@keydown:common</instruction>
			</function>
		</button>
	</button>
	<button backcol="none" display="label" icon_size="large" label_pos="right" textcol="none" type="three_button">
		<label>Set Blue Label</label>
		<icon1>#newmenu</icon1>
		<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
			<label>On</label>
			<icon1>#setcolor</icon1>
			<function type="normal">
				<instruction>@toggle:disable</instruction>
				<instruction>@disablenosel</instruction>
				<instruction>//@keydown:none</instruction>
				<instruction>  Properties SETLABEL=Blue SETLABELTOGGLE ADDLABEL</instruction>
				<instruction>//@keydown:shift</instruction>
				<instruction>//  Select PATTERN=Match_Blue FILTER FILTERFLAGS=deselect </instruction>
				<instruction>//  Properties SETLABEL=Blue SETLABELTOGGLE ADDLABEL</instruction>
				<instruction>//@keydown:common</instruction>
			</function>
		</button>
		<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
			<label>Off</label>
			<icon1>#setcolor</icon1>
			<function type="normal">
				<instruction>@toggle:disable</instruction>
				<instruction>@disablenosel</instruction>
				<instruction>//@keydown:none</instruction>
				<instruction>//  Properties SETLABEL=Blue SETLABELTOGGLE ADDLABEL</instruction>
				<instruction>//@keydown:shift</instruction>
				<instruction>  Select PATTERN=Match_Blue FILTER FILTERFLAGS=deselect </instruction>
				<instruction>  Properties SETLABEL=Blue SETLABELTOGGLE ADDLABEL</instruction>
				<instruction>//@keydown:common</instruction>
			</function>
		</button>
	</button>
	<button backcol="none" display="both" icon_size="large" label_pos="right" textcol="none" type="menu">
		<label>Aliases/Labels</label>
		<icon1>#setcolor</icon1>
		<button backcol="none" display="both" textcol="none">
			<label>Aliases Management</label>
			<icon1>#rename2</icon1>
			<function type="normal">
				<instruction>Prefs Page aliases </instruction>
			</function>
		</button>
		<button backcol="none" display="both" label_pos="right" textcol="none">
			<label>Create Label</label>
			<icon1>#setcolor</icon1>
			<function type="normal">
				<instruction>Prefs Page=Labels</instruction>
			</function>
		</button>
		<button backcol="none" display="both" separate="yes" textcol="none">
			<label>Assigned Labels</label>
			<icon1>#setcolor</icon1>
			<function type="normal">
				<instruction>Prefs Page assignedlabels </instruction>
			</function>
		</button>
		<button backcol="none" display="label" field_type="label" size="full" textcol="none">
			<label>Set Label</label>
			<icon1>#label</icon1>
			<function type="normal">
				<instruction>Set LABEL</instruction>
			</function>
		</button>
		<button backcol="none" display="label" textcol="none">
			<label>Set Label</label>
			<function type="normal">
				<instruction>Properties SETLABEL</instruction>
			</function>
		</button>
	</button>
</button>

1 Like

Thx guys! But since my original post it has been implemented into DOpus.

To set the label: Properties SETLABEL=_cyan ADDLABEL
To remove the label: Properties SETLABEL=_cyan SETLABELREMOVE
It works with multiple LABELS set.

Im attaching a pic so u can see how i use my buttons:
label_buttons
The text adds the label and the "X" removes it.

1 Like