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?


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!


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

Both these work as expected:

Disables if you haven't selected any .cloud files

Disables if you have selected any .cloud files


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