Scripting: Check if a file is selected?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Scripting: Check if a file is selected?

Post 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...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting: Check if a file is selected?

Post by admin »

In the next beta you can try <cc_isselected>.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Scripting: Check if a file is selected?

Post 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;
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting: Check if a file is selected?

Post by admin »

Um, you are aware of this?: View | Sort By | Selected Items to Top

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Scripting: Check if a file is selected?

Post 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!
One of my scripts helped you out? Please donate via Paypal

Post Reply