Using "Load" to bring up a sub menu

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Using "Load" to bring up a sub menu

Post by SkyFrontier »

Inside the script you'll find proper notes on how to set it up.
Basically, you have to manually set the collection of scripts under the '$a' variable - top of the script.
Then, follow the guidelines on my previous post in this thread so you'll tell the script which scripts will fall into which category.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

CookieMonster

Re: Using "Load" to bring up a sub menu

Post by CookieMonster »

SkyFrontier wrote:Inside the script you'll find proper notes on how to set it up.
Basically, you have to manually set the collection of scripts under the '$a' variable - top of the script.
Sorry, I don't understand what you mean ?

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

Re: Using "Load" to bring up a sub menu

Post by bdeshi »

You've supposedly bought SublimeText to work with scripts. So you already know scripts are just text files.
Then what do you think "Inside the script" means?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

CookieMonster

Re: Using "Load" to bring up a sub menu

Post by CookieMonster »

SammaySarkar wrote:You've supposedly bought SublimeText to work with scripts. So you already know scripts are just text files.
Then what do you think "Inside the script" means?
Obviously, I know what what Inside the script means, I don't know what is the written text inside the script !

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Using "Load" to bring up a sub menu

Post by SkyFrontier »

// *** How to Attribute Groups *** \\
//-set a simple caption, no script attached to it, immediately _below_ the group of scripts
// it will hold. This caption will name the respective group on the main menu.
//-logically, the last group will need a caption - it'll be the last entry at the "$a" variable.
//--if the last caption missing, the last entry on the main menu will still work, ie: will have
//--an accelerator, have an empty name field plus respective items count.

Unless you're not understanding what's written... in this case, my apologies. Let me know. Tried to make it the more straightforward I could, in ways newcomers could benefit out of it.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

CookieMonster

Re: Using "Load" to bring up a sub menu

Post by CookieMonster »

No, Sorry, I'm not understanding ? :( :)

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Using "Load" to bring up a sub menu

Post by SkyFrontier »

Well.

Consider this:

Code: Select all

"exitnosave|:exitnosave"
   copytext ":exitnosave"
"rfo|:rfo"
   copytext ":rfo"
 echo hi;
"mru|:mru"
   copytext ":mru"
"myco|:myco"
   copytext ":myco"
"***group 1***"
"flatview|:flatview"
   copytext ":flatview"
"views|:views"
   copytext ":views"
"minitree|:minitree"
   copytext ":minitree"
"dp12|:dp12"
   copytext ":dp12"
"_____most used______"
"newtab|:newtab"
   copytext ":newtab"
"closetab|:closetab"
   copytext ":closetab"
"locktab|:locktab"
   copytext ":locktab"
"((( MIGHT HAVE USE )))"
"{drives_avl}|:{drives_avl}"
   copytext ":{drives_avl}"
"{drives_fix}|:{drives_fix}"
   copytext ":{drives_fix}"
"@@@ excluded @@@"
"ctb64|:ctb64"
   copytext ":ctb64"
 echo hi;
"%%% LAST SET %%%"
Open my script with a text editor (or rename its extension from .xys to .txt and open it using your default text editor) and paste the above set as a value for "$a". As you can see when you run the script, you'll have 5 categories:

Code: Select all

"***group 1***"
"_____most used______"
"((( MIGHT HAVE USE )))"
"@@@ excluded @@@"
"%%% LAST SET %%%"
holding a number of scripts.
Each category is set by putting all desired scripts immediately above it. Like this:
"scr 1"
commands
"scr 2"
commands
"group 1"

Group 1 will have "scr 1" and "scr 2" in a submenu. Continuing,
"scr 1"
commands
"scr 2"
commands
"group 1"
"scr 3"
commands
"scr 4"
commands
"group 2"

Now you told my script to group "scr 3 & 4" in a "group 2", so the final menu will appear like
"1 - group 1 - 1 item(s)"
"2 - group 2 - 2 item(s)"
-standard: "accelerator - user input group name - item count".

The "$a" variable can be found near the top of the script (see reference below*) and looks like

Code: Select all

   $a = <<<#
"exitnosave|:exitnosave"
   copytext ":exitnosave"
...
"ctb64|:ctb64"
   copytext ":ctb64"
 echo hi;
"%%% LAST SET %%%"
#;
Your only work is to replace the default set of scripts with your own one.
First, remove everything inside of it, leaving it like

Code: Select all

   $a = <<<#
#;
-observe that the "#;" characters MUST stay, otherwise everything will be flushed!

Then, position your caret in front of the '#;' and paste your set of scripts. Make sure that '#;' remain immediately below the pasted content, set the captions as described and execute the script.
_________
*Reference: this is a discussion on Method - XYscriptsGrouping, especially XYscriptGroups_v2_uSERsETgROUPS_by_SF.xys.
Last edited by SkyFrontier on 23 Jul 2015 03:42, edited 1 time in total.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

CookieMonster

Re: Using "Load" to bring up a sub menu

Post by CookieMonster »

and paste the above set as a value for "$a"
This is where I may be hung up ?

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Using "Load" to bring up a sub menu

Post by SkyFrontier »

Check out my previous post in a few minutes - I'll update it focusing your point.
Chocolate time, sorry! :cup:
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Using "Load" to bring up a sub menu

Post by SkyFrontier »

Chocolated. :P
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Using "Load" to bring up a sub menu

Post by SkyFrontier »

-did it worked?
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

CookieMonster

Re: Using "Load" to bring up a sub menu

Post by CookieMonster »

I never did anything; you said you were going to update focusing on my point after chocolate time ? :)

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Using "Load" to bring up a sub menu

Post by SkyFrontier »

SkyFrontier wrote:Chocolated. :P
= done. :P
(ie, explanation post above was updated!)
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

CookieMonster

Re: Using "Load" to bring up a sub menu

Post by CookieMonster »

... and paste the above set as a value for "$a"
How do I paste something with a value for "$a" ? :)

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Using "Load" to bring up a sub menu

Post by SkyFrontier »

Something: your collection of scripts.
Paste: from a copy (ctrl+c) of something.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply