Button selection to checboxes + toggle

I'm trying to make a button that would turn selection to checkboxes but if no files or folders are selected then turn off checkbox mode.
I tried

Set CHECKBOXMODE=Off 
@firstfileonly 
Select TOCHECKS

but it works as just Select TOCHECKS.

I don't think there is a good way to do that.

The @firstfileonly check will be done before any of the commands are run (even if it is on the second line), and if you are already in checkbox mode then it should restrict the button to using the first checked item (not the first selected item). So it would test the wrong thing at the wrong time, for what you're aiming to do.

Try following instead:

@ifset: CHECKBOXMODE=Toggle Select FROMCHECKS Set CHECKBOXMODE=Off @ifset:else Select TOCHECKS

Wow, great.
Now I don't even need button "Checkboxes to Selection". :thumbsup: