Scripting to scroll selected folder to the Usability Scroll Margin

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

Scripting to scroll selected folder to the Usability Scroll Margin

Post by hermhart »

Hello,

I have several scripts that I use that open new tabs and go to different locations on the network. Is there anything that I can add that will use something like the Usability Scroll Margin so that when I run my scripts they will scroll those selections to near the top?

What I am using so far just to do the above stated actions:
#340; //new tab
tab("rename","Exports");
goto "C:\Exports";
#347; //set Home

Thank you for any help that can be provided.

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

Re: Scripting to scroll selected folder to the Usability Scroll Margin

Post by jupe »

What selections?, you have none made in the script above. Checkout these commands:

sel()
selectitems()
#318;

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

Re: Scripting to scroll selected folder to the Usability Scroll Margin

Post by hermhart »

In the Tree it selects the goto target. It would be nice if it is doing a 'goto' to someplace buried deep in a structure that it would scroll the Tree up to the Scroll Margin.

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

Re: Scripting to scroll selected folder to the Usability Scroll Margin

Post by jupe »

showintree is a scripting command, it doesn't do exactly what you are asking though, but is as close as is possible AFAIK, so the answer to your question is no, now that you have made it clear we are talking about the tree not the list.

Another possibility though is that you could make up a minitree with only some items in it, which would move the one you wanted to the top artificially.

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

Re: Scripting to scroll selected folder to the Usability Scroll Margin

Post by hermhart »

Thank you for your help. Not exactly what I am looking for. I know Don (admin) some time ago made it so that if you clicked a link under the Links folder that it would scroll that item using the Scroll Margin. I was hoping the same could be done for for my 'goto' items in the Tree.

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

Re: Scripting to scroll selected folder to the Usability Scroll Margin

Post by jupe »

I just remembered this, when you said that:

Code: Select all

v18.80.0003 - 2018-03-08 14:32
    + Tree: Added tweak to auto-move the selected folder to the top of the view.
        TreeSelectedToTop=1
      Ever since the selected folder is moved to the top of the view when it was 
      above the view before being selected. However, when it was within the view 
      it is not moved at all, and when it was below the view it is moved to the 
      bottom of the view. The strategy here is to minimize the amount of 
      vertical scrolling. But to have the selected folder consistently at the 
      top might also be a valid strategy.
      Notes:
      - Selecting a folder right in the tree does *not* trigger the auto-move. 
        It would just drive you crazy.
      - Near the bottom of the tree it might not be possible to bring the folder 
        up to the top. That's tree physics you got to live with.
      - The setting of "Configuration | Menus, Mouse, Safety | Usability | 
        Scroll margin" is honored, so you can have the folder auto-moved e.g. to 
        the 3rd row of the view if you like.
      - Might make this an official setting later
for instructions on how to tweak:
https://www.xyplorer.com/faq-topic.php?id=tweak

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

Re: Scripting to scroll selected folder to the Usability Scroll Margin

Post by hermhart »

THAT'S IT!

Thank you very much!

:appl: :appl: :appl:

Post Reply