Negating @hidenosel in command

Hello again!

I'd like a toolbar button to show only if nothing is selected - so effectively the opposite of @hidenosel.

How can I do this?

Thanks!
T

I don't think it's possible, unless there's a trick I can't think of. It tests what is selected, not what isn't.

Darn! Alternatively is there a way to check if {filepath} is blank?

I need a button that is visible only when you've clicked on a folder in the tree but haven't yet selected a file.

Thinking about it, something like @!hidenosel might make sense.

In the next update you'll be able to use @hidenosel:! for this.

Perfect, thank you!

Leo,

I think this actually works already, after further experimentation. The standard Pattern Matching Syntax appears to work perfectly.

Both these work as expected:

@disablenosel:type=(.cloud)
Disables if you haven't selected any .cloud files

@disablenosel:type=~(.cloud)
Disables if you have selected any .cloud files

Thanks!
T

That might work. I thought you wanted to detect when nothing was selected? (Not just a selection with no .cloud files.)

Yes sorry you are right. The .cloud applies to other buttons in the same toolbar.

I'll try type=~(*) and similar when I'm next at my PC, and report back.

Confirmed, type=~(*) doesn't work.

Thanks! T

Actually a nicer change would be to support something like @enableif:xxx, @showif:xxx, where using that disables/hides by default unless the selection matches xxx.

1 Like