Folders in Favourites?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
sl23
Posts: 295
Joined: 03 Feb 2015 23:34
Location: XYplorer 64 Latest beta, Win11x64 25H2, 1920x1080 @100%

Folders in Favourites?

Post by sl23 »

When creating many Favourites, I'd like to create a Sub-Folder to keep them in for easier navigation, is that possible?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Folders in Favourites?

Post by bdeshi »

Umm, yes (theoretechnically). You need a parent which is actually a script. But that can't be done using the normal Favorites menu items. you need to use Tools > List Management > Favorite Folders (or Files)
Then add this as a favorite:

Code: Select all

"SubFavs demo" ::$paths = "C:\<crlf>D:\<crlf><xydata>";load "$paths",,s; //add children to $paths separated by <crlf>
Favorites > Favorite folders > SubFavs Demo Now hosts a submenu.

This can be mostly automated using a shortcut/button/UDC and a couple little (sub)scripts: one for the addition, and one to actually store and display the favorites.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Folders in Favourites?

Post by Stef123 »

Very neat trick, Sammay :appl: :appl:
Could I somehow thweak this into calling my already existing CTB-dropdowns?
For the same reason as sl23 I have set up a few additional CTB dropdowns that hold nothing but GoTo lines. Your trick would not only tidy up my toolbar, it would also give me access to these "custom fav-folder CTBs" from the right-mouse popup.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Folders in Favourites?

Post by bdeshi »

Code: Select all

"SubFavs CTB dock" ::button "ctb11" /*source ctb*/, 1 /*1:left-click, 2:right-click*/;
"your trick would not only tidy up my toolbar" - when using the SC button, you can actually remove the source (ctb11, or whatever) from your toolbar altogether (without clearing the button-scripts ofcourse). :wink:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Folders in Favourites?

Post by Stef123 »

Still struggling with this one. Meanwhile I've managed to run it without getting an error message, but it just doesn't do anything, the statusbar says "script terminated by user". I left out what I came to know as /*comments*/, tried it with and without semi-colon at the end :?
What should it do? Bring up my CTB left and right click menus depending on whether I specify 1 or 2, right?
I also tried renaming my CTB, makes no difference, though. :?:

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Folders in Favourites?

Post by bdeshi »

what
Stef123 wrote:What should it do? Bring up my CTB left and right click menus depending on whether I specify 1 or 2, right? [...] :?:
Exactly.
Did you assign the intended ctb to button? The "ctb11" I used is actually the ID of button (the part in [] in Customize Toolbar dlg from a ctb). not it's name (chagning button names won't affect it either)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Folders in Favourites?

Post by Stef123 »

Ha - got it. :biggrin:
Cannot tell you what I did differently this time. Should have kept the first entry instead of overwriting it, to compare. Anyway, it works now. :D This will translate into a cleaner toolbar and give me a really super-charged context menu.

One more thing, Sammay - how do get to edit those invisible CTB-buttons? Any chance to pack a kind of self-referencing Edit-call into their subfolders?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Folders in Favourites?

Post by bdeshi »

Great!
Stef123 wrote:One more thing, Sammay - how do get to edit those invisible CTB-buttons? Any chance to pack a kind of self-referencing Edit-call into their subfolders?
if the button doesn't have (or maybe didn't used to have) a right-click script, ::button "buttonID", 2; will popup the usual Click/Edit/Customize menu.
But if it has (used to have) a RClick script, then what? Hold CTRL and do that again! :o
Now the sensible thing would be to always hold CTRL and exec that script no matter if the btn has a rclick script or not.

Aside from creating a menu out of those hidden btns, you can also create a menu for editing them, removing any reason to let those buttons play outside (poor buttons! :cry: )

Code: Select all

"Favs of ctb1" button "ctb1", 1;
"Favs of ctb2" button "ctb2", 1;
...
"Favs of ctb42" ::button "ctb42", 1;
"-"
"[hold CTRL]"
"edit ctb1" button "ctb1", 2;
"edit ctb2" button "ctb2", 2;
...
"edit ctb42" ::button "ctb42", 2;
:D
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]


Stef123

Re: Folders in Favourites?

Post by Stef123 »

Went with the second suggestion - very smooth and immediate

Code: Select all

userbutton 18, 128;  
Thanks TheQwerty :appl: and Sammay too, for taking the time to explain. Learned some other stuff along the way, by accident :titter:

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Folders in Favourites?

Post by bdeshi »

:tup:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply