Page 1 of 1

Scripting: Check if a file is selected?

Posted: 03 Jan 2022 20:12
by highend
Is there a direct way to check if a specific file (full name) is currently selected or not?

Without the need to use <selitems> or <get SelectedItemsPathNames> and a check if that file is part of it?

It's for a cc with <x> k entries so the above two options are out...

Re: Scripting: Check if a file is selected?

Posted: 04 Jan 2022 11:26
by admin
In the next beta you can try <cc_isselected>.

Re: Scripting: Check if a file is selected?

Posted: 04 Jan 2022 13:48
by highend
Thanks for trying but this is too limited atm because you can't sort by it (because of only updating on refresh and via the list trigger).

A script selects 16 entries out of {x} k ones (by condition with a specific prioritization) and it would be a big visual help if I could sort that column so that I can put the 16 selected at the top of the list.

Something like this works fine but it's just not fast enough for so many pane entries...

Code: Select all

    if (regexmatches(<selitems <crlf>>, "^" . regexreplace(<cc_item>, "([\\.+*|?(){\[^$])", "\$1") . "(\r?\n|$)")) { return 1; }
    return 0;

Re: Scripting: Check if a file is selected?

Posted: 04 Jan 2022 14:49
by admin
Um, you are aware of this?: View | Sort By | Selected Items to Top

Re: Scripting: Check if a file is selected?

Posted: 04 Jan 2022 18:32
by highend
It was just an example (e.g. at the top) but I guess that's the most frequently used option so I'll go with that. Thanks for the new variable!