Toggle Label And Tag At The Same Time

I'm trying to use a button to toggle a bookmark label on/off, but also swap its tag at the same time. Can't seem to get this @if statement to work.

Properties SETLABEL="Marked" SETLABELTOGGLE
@if:FILTERDEF tags match FILE
SetAttr META tags:"-FILE +BMFI"
@ifelse:FILTERDEF tags match BMFI
SetAttr META tags:"-BMFI +FILE"

Could someone help please.

I thought it's because the "FILE" tag could be anywhere within the tags.
But something like this (FILE) still doesn't work. (wildcards around the word FILE)

What made you think @if supports FILTERDEF?

Command modifier reference

1 Like

What made you think FILTERDEF is command?

Internal Commands

1 Like

Why did I get cursed with these answers.

Hello @ASUNDER !
Well, you're right. I couldn't get the @if to work either using @if:SetAttr META "tags:FILE".
Clearly this is a command. But we're attempting to do an @if: on a file by file basis rather than a global button basis. I'm not the person to properly answer this.

Note that you have several syntax mistakes !

Good, that works fine.

Incorrect syntax.

Incorrect syntax.

Incorrect syntax.

The SetAttr commands by themselves with a little more attention to syntax work fine.

I started thinking about an Evaluator solution to this, I don't have it as of now.
I'm not an expert here, I just try to think things through and make mistakes along the way !

Nobody is cursing you. Directory Opus is also extremely difficult to write.
We have what we have. I remember when the idea of adding tabs to Directory Opus was a bit controversial.

Good Luck !

Ya. I'm trying to do a basic IFTT, "if tag A then tag B. If tag B then tag A".
If I have my bookmark button on my lister header; and it will auto-add or take away a tag, then I can sort that tag column in reverse and now I have a "pin to bottom" function. But not if I can't swap out the tags.

Incorrect syntax.

SetAttr META tags:"-FILE +BMFI"

Oh ya, forgot I need the semicolon.

If I get rid of the word META I get a dialogue pop up.

Incorrect syntax
@ifelse:
Ok. It's if:else, thanks.

True. It's just a basic test so I must be missing some aspect.

Indeed. And the ones who are, have their own forum evaluator.

Go User="asks question"
@if:date:monday
Set:ignore
@if:else date:tuesday
Set:ignore
@if:else date:wednesday
Set:ignore
@if:else date:thursday
Set:ignore
@if:else date:friday
Set:answer basic ass question in thirty seconds

Got to catch them on a good mood day or something. You know, cause we're all grown men n stuff.

They say when you go to buy something expensive, try to find a Monday build instead of a Friday one.

Plan B.
Use two buttons.

Alternating purple / hollow purple.
Solid purple is "select by bookmarks". Hollow is "set bookmark with tags".

Solid:
Left click: select if marked
Right click: select if not marked

Hollow:
Left click: add mark
Right click: remove mark
Middle mouse: send to bookmarks collection

I have to keep tag distinctions between files and folders too, for filtering and finding.
So:
@keydown:none
Add or remove label (left or right click) both file or folder, whatever is selected. No tag swap.
@keydown:ctrl
folders, swaps bookmark folder tag with folder tag.
@keydown:shift
files, swaps bookmark file tag with file tag.