Favorite files & folders

Discuss and share scripts and script files...
Post Reply
Posts: 10779
Joined: 06 Feb 2011 00:33

Favorite files & folders

Post by highend »

A favorite (files/folders) script^^

For what?

Code: Select all

01. It supports nested entries (via submenus)
02. Quick selection (a-z 0-9, characters can be defined) is supported
03. All three functions can be triggered via hotkeys (show, toggle, manage)
The schema for the stored favorites (in an .ini file with the same name as the main script file) is:
{indention level}<>{file/folder}
E.g. for a "Files" section:

Code: Select all

1<>T:\!The Unofficial XYplorer Archive\Create archive file list.xys
1<>T:\!The Unofficial XYplorer Archive\@Archive file list.txt
1<>D:\Users\Highend\Development\XYplorer\Beyond Compare.xys
which would lead to a nested menu like this:
1.png (7.65 KiB) Viewed 190 times
Or a screenshot to better see how quick selection can work (chars are 123456789abcdefghijklmnopqrstuvwxyz)
3.png (6.92 KiB) Viewed 135 times
If you use the "manage" function of the script you need to follow this schema!

0 is the root level and items inside a submenu need a +1 increased indention level (in comparison to the indention level of their belonging submenu)

Submenus itselves do not get a quick selection prefix, only file(s) or folder(s)!
You can jump to submenus by their first character of their name and if two submenus on the same level have the same first character, it would toggle between them.
Standard Windows behavior...

Toggeling a favorite depends on the .ini setting: AdvancedToggle
If AdvancedToggle is set to true you get this kind of inputfile() requester:
2.png (19.71 KiB) Viewed 190 times
The three indented entries --- allow you to drag and drop the first item (that's the one that currently should be added as a favorite file)
into a position (right under such a --- line) one nested level higher.

E.g. dropping it after: D:\Tools\XYplorer\@Knowledgebase\!Roadmap.url
would add it to the other submenu but dropping it after the following ---
would instead place the item at the root level again!

If AdvancedToggle is set to false you don't get such a window at all, every time a favorite needs to be added it would be put on the top of the list (with an indentation of 0) automatically and if you'd like to change its position and (if necessary) its indentation you would need to do it by using the "manage" functionality...

If a favorite (files/folders) list only consists of 0 indented entries, AdvancedToggle is internally set to false.

You can always get the opposite of the current defined behavior of AdvancedToggle by holding the shift button when the script is executed.

The main script is never executed directly!
Instead, this is the script file that you need to execute that loads the main script:

Code: Select all

    // Set this to either "files" or "folders"
    perm $P_Favs_Type = "files";

    // Set it to the main script file to load
    // Without any path it's expect to be in the XY's script folder
    $scriptFile = "Favorite files & folders.xys";

    // For normal access via a button
    perm $P_Favs_MBtn = get("trigger", "mousebtn");
    perm $P_Favs_KMod = get("trigger", "callshift");

    // To access "show", "toggle" or "manage" directly,
    // uncomment the next line and use one of the three keywords above
    // E.g. to toggle a favorite via a UDC and a keyboard shortcut:
    // perm $P_Favs_Func = "toggle";

    load $scriptFile;
E.g. put it on a button or create a user defined command for it / them.
You need at least two of them.
One with perm $P_Favs_Type = "files"; and one with perm $P_Favs_Type = "folders";
Uncomment // perm $P_Favs_Func = "toggle"; if you want to access one of the functions of the main script directly and use a user defined command for it (with a keyboard shortcut).

Favorite files & folders_v0.1.xys
(22.84 KiB) Downloaded 21 times
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Posts: 10779
Joined: 06 Feb 2011 00:33

Re: Favorite files & folders

Post by highend »

One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Post Reply