COPY command quirks in "if" clause

Hi
why doesn't this :point_down: button work?

@if:set dual=on 
copy
@if:set dual=off
clipboard copy

this command function is ok in dual display mode but when dual is off (@if:set dual=off or "@if:else") instead of doing the "clipboard copy" it brings up the "select destination folder" dialog box! The 2nd part of the code doesn't run at all whenever the "copy" command is there. but if I substitute "copy" with something else, it works like a charm. only "copy" behaves like this.

how do I achieve this functionality anyway?

Because copy is parsed before @if.

It will if you pick something from the dialog.

1 Like

got it. thanks.

but can I have a button like that by using JS scripts, etc.? (copy to dest in dual display mode and copy to clipboard in single display)

and how/where can I read about the parsing order of the other commands? I haven't come across this info in the docs yet.

The evaluator can take care of it:

=return (dest=="" ? "clipboard " : "") + "copy"

I don't think there is anything. That's unwritten knowledge passed from one sorcerer to the next on moonless nights.

1 Like

joy
got it. thanks for passing it down on this moonless night, elder sorcerer! :ok_hand: :joy: :pray: