Page 1 of 1

Select an item in the Tree with scripting

Posted: 18 Feb 2015 21:19
by hermhart
Is there a way to focus an item in the Tree with scripting? I know I can use Focus T; and that will put focus on the Tree itself, but how can I select an item like "Network"?

Re: Select an item in the Tree with scripting

Posted: 18 Feb 2015 21:28
by highend
What's the use of selecting an item in the tree?

Just use e.g.

Code: Select all

 goto "Network";

Re: Select an item in the Tree with scripting

Posted: 18 Feb 2015 21:35
by hermhart
OMG, I thought I tried that and it didn't work. I'm sorry. So simple too. :(

The reason i want this is I have a simple script to reset my interface when I'm done and have it collapse everything, focus back to "Computer", and minimize the Window. But for some reason, the collapse would not collapse the "Network" tree item.

Thank you so much.

Re: Select an item in the Tree with scripting

Posted: 18 Feb 2015 22:06
by klownboy
Hi hermhart, so I take it you were already using the commands to collapse the tree. I do something similar but I collapse using the collapse command along with changing the layout back to my "normal layout" and goto "C:\". If you haven't already, look under Help | List all Commands and type in Collapse in the search box. You'll see that Collapse Tree and Drive have keyboard shortcuts

Code: Select all

#1009	Miscellaneous | Tree | Fully Collapse Drive	 (Ctrl+Numpad Divide)
#1010	Miscellaneous | Tree | Fully Collapse	 (Numpad Divide)
Though they may differ if you've changed key assignments. As you probably already know (but just in case), they also have command IDs like #1009 and #1010 that you can use in a script to collapse the tree.

Re: Select an item in the Tree with scripting

Posted: 19 Feb 2015 00:39
by hermhart
klownboy, thank you. I actually do use those commands, they are extremely handy.