I don't fully understand your question, but you can definitely load scripts through a Hamburger menu, either by providing their
#ID after registering them as a
UserDefinedCommand (recommended) or through
QuickScripting, which is what we call one-liners that start with
:: and can be executed in various locations...
|>MyScript (UserDefiniedCommand)|#1234|icon.ico
|>MyScript|::load "<xyscripts>/path/to/script.xys";|icon.ico
Read the help file for a bit more info...
Code: Select all
Quick Scripting
Quick Scripting means: Scripts, when prefixed with "::" (double-colon), can be executed directly (i.e. quickly) through any interface in XYplorer that can process locations: Address Bar, Go To, Favorites, Catalog etc
If you want to chain commands through QuickScripting, simply separate them with a
;, the same as you would do in
Multi-LineScripts...
|>MyScript|::$name = input("GreeterBot 3000", "What is your name?"); echo "Hello $name";|icon.ico
-----------------------------
If the CustomToolbarButton should load a
.xys directly without displaying a Hamburger menu, there are a couple ways to do so...
1) [Recommended] Register the
.xys as a
UserDefinedCommand in the
User > Manage Commands > Load Script File menu and then copy the #ID on the bottom-right of the window. Paste that ID number into the button field;
On left-Click: #1234
2) Add a QuickScripting line directly to the button field;
On left-Click: ::load "C:\path\to\script.xys";
-----------------------------
Using
popupnested() instead of Hamburger menus allows you to get more complex with your menus, since you can set variables outside the menu, define\call functions, choose where in XY the menu is displayed, and whatever else you can do with Multi-LineScripts.
It's my preferred menu option when doing any kind of complex tasks, such as I did in my
7-ZipXY and
ImageMagickConverter scripts, both of which use
popupnested() to display the menu and then QuickScripting to perform the selected command. Both those scripts are fragments of a much larger
popupnested() menu I use, but the structure is basically the same throughout.
Look through those files for examples of
popupnested(), maybe you'll find some answers.