Folder View Settings Script

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
hermhart
Posts: 213
Joined: 13 Jan 2015 18:41

Folder View Settings Script

Post by hermhart »

Is there a way to run a script with Folder View Settings?

I am trying to figure out if I can sort specifically named folders in a certain way and have them scroll to the bottom of the list.

jupe
Posts: 2805
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Folder View Settings Script

Post by jupe »

FVS can save sort order, but not scroll to bottom, but you can achieve both tasks via:

Configuration | General | Custom Event Actions >> Changing Locations

hermhart
Posts: 213
Joined: 13 Jan 2015 18:41

Re: Folder View Settings Script

Post by hermhart »

That is a great suggestion. I hadn't thought of that, and will be looking into it. Thank you!

hermhart
Posts: 213
Joined: 13 Jan 2015 18:41

Re: Folder View Settings Script

Post by hermhart »

If you don't mind, I have one more question pertaining to what I found. I have the following script I created and put it in:
Custom Event Actions > Changing Locations > After browsing a folder

Strange thing is, if I put it in the CEA, it runs, but still puts the focus on the file at the top. If I run it as a standalone script, it puts the focus on the file at the bottom like I want. Any ideas on why running the same script is giving me two different results?

Code: Select all

 if (<curfolder> == "Pictures") {
    sortby m, a;
    topindex(b, a);  //scroll to the bottom of the list
    sel -1, , 1;     //select the last item in the list
    sel;             //deselect all
    focus L;
 }

jupe
Posts: 2805
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Folder View Settings Script

Post by jupe »

It might work more reliably in "After Painting the file list" event.

PS: topindex wouldn't be necessary when also using sel -1, or you could use it instead of the 2 sel lines depending on your requirements.

hermhart
Posts: 213
Joined: 13 Jan 2015 18:41

Re: Folder View Settings Script

Post by hermhart »

Thank you so much, it worked!

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Folder View Settings Script

Post by RalphM »

Is it just me?
Wouldn't it make more sense to "sortby m, d;" and have the top item selected automatically.
My brain must be wired differently as i never understood why the newest item should be at the bottom of any list.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

hermhart
Posts: 213
Joined: 13 Jan 2015 18:41

Re: Folder View Settings Script

Post by hermhart »

For the particular folder that I am working with, I just prefer everything to be in that order.

Post Reply