Load multiple scripts from one script file

Features wanted...
Post Reply
jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Load multiple scripts from one script file

Post by jacky »

Yeah, so I don't know what's on your list for Scripting 2.0, this might be on it already, but it is on mine and I don't think I mentioned it already so here we go ;)

One little thing I would love is to be able to specify more than one label when using the command load, and what that would mean is that XY would popup a menu, but containing only items for the mentioned/listed scripts, not the entire thing !

That would be really cool, because it could allow me for example to popup one menu with only the scripts I use the most, it's quicker/either that way, but to have still the ability (could even be one of the scripts/menu items) to load the complete menu when I need to.

That way, instead of having to split a menu for a given project over two or three script files, which isn't the best for a few reasons and also sucks when there's common subs to use almost everywhere, or one script you'd want in every menu.
Right now to do that, it's either one big menu, or some duplicates (same scripts in different script files, etc) and it's really not ideal.

But, if I could do things like "load file, id1;id2;id3;id6" then I could have one single script file, containing all scripts I could need for a given project, while yet only using a UDC that would popup a menu with only the most common scripts I need (plus a "Show full menu..." item that would do a "load *")

The only thing would be the separators, but I would imagine XY could just check never to start or end a menu with one, or put more than one sep in a row (unless specifically said so in the file, ie. not due to "ignored" scripts/items)
Proud XYplorer Fanatic

admin
Site Admin
Posts: 65089
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Load multiple scripts from one script file

Post by admin »

jacky wrote:But, if I could do things like "load file, id1;id2;id3;id6" then I could have one single script file, containing all scripts I could need for a given project, while yet only using a UDC that would popup a menu with only the most common scripts I need (plus a "Show full menu..." item that would do a "load *")

The only thing would be the separators, but I would imagine XY could just check never to start or end a menu with one, or put more than one sep in a row (unless specifically said so in the file, ie. not due to "ignored" scripts/items)
What about allowing this syntax for the label argument:
load file, "id6;-;id2;id3;-;id1"

Means: you could
(1) choose which scripts from the resource to show in the menu
(2) in which order
(3) place separators

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Load multiple scripts from one script file

Post by jacky »

admin wrote:What about allowing this syntax for the label argument:
load file, "id6;-;id2;id3;-;id1"

Means: you could
(1) choose which scripts from the resource to show in the menu
(2) in which order
(3) place separators
Yeah, even simpler/easier!
Proud XYplorer Fanatic

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

This works perfectly! Thanks a lot for this great addition! :D

I've already converted what used to be 3 script files into one, much easier, no more duplicate content, I love it!

One little thing I noticed though, when using the load command to get a menu, all given script ids will be shown & enabled, even if there was no script behind it; whereas a "normal" execution would have had the items disabled. Quick example in case that's not clear:

Code: Select all

"Disabled : disabled"
"Enabled : enabled"
 load *, "disabled;enabled";
Click on Enabled the first time, and in the new menu item "Disabled" will actually be enabled...
Proud XYplorer Fanatic

admin
Site Admin
Posts: 65089
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

jacky wrote:This works perfectly! Thanks a lot for this great addition! :D

I've already converted what used to be 3 script files into one, much easier, no more duplicate content, I love it!

One little thing I noticed though, when using the load command to get a menu, all given script ids will be shown & enabled, even if there was no script behind it; whereas a "normal" execution would have had the items disabled. Quick example in case that's not clear:

Code: Select all

"Disabled : disabled"
"Enabled : enabled"
 load *, "disabled;enabled";
Click on Enabled the first time, and in the new menu item "Disabled" will actually be enabled...
Yep, fixed. (no mention in history)

Post Reply