a.) You can either load the script via
Menu - User - Manage Commands...
Category: Load Script File
Right upper side: "New..." Button -> Add new command
Caption: <however you want to name it>
Script File: <the path to your .xys script>, e.g.: D:\Temp\Menu.xys
And when done, on the bottom "Assign Keyboard Shortcut"
==================================================
It's nearly the same if you've chosen to use a user button in the toolbar
Look up how the button you want to execute / clicked is named
Ctrl + Right click on any toolbar icon -> Customize Toolbar...
In the right list, look what's in the [...] part of that specific
button
Let's say it's: [ctb7]
Here it's the name of a custom button...
Now:
Menu - User - Manage Commands...
Category:
Run Script
Right upper side: "New..." Button - Add new command
Caption: <whatever>
Script: button "ctb7";
Is the script command that you want to get executed. It emulates a mouse click
on that specific button...
And when done, on the bottom "Assign Keyboard Shortcut"
b.)
It's a simple "-" but without the quotation marks
Like
Code: Select all
$toolbars = <<<>>>
Default;back,fore,up,refresh,-,exitnosave
-
Branch view;flatview
>>>;
c.)
Change it like this:
Code: Select all
$menus = <<<>>>
Branch view;#311
>>>;
$selected = popupmenu($menus, , , , , , <crlf>);
if ($selected) { load $selected, , "s" }
else { status "No item chosen, aborted!", "8B4513", "stop"; }
You can leave out the else... line if you want
The same principle can be used for the toolbar code as well
d.)
Execute this from the address bar:
This gives you the ,-separated list of the currently defined items on your toolbar.
Let's say you get:
back,fore,-,myco,hotlist,openwith,-,ctb2,ctb3,ctb17,-,ctb4,ctb12,-,ctb6,ctb7,-,ctb1,ctb11,ctb18,ctb13,ctb14,ctb15,ctb16,-,undo,redo,-,ctb8,-,cofi,tsf,visualfilter,icf,cucopy,-,ctb9,-,conf,savesett
Then you do it like this:
Code: Select all
$toolbars = <<<>>>
Default;back,fore,-,myco,hotlist,openwith,-,ctb2,ctb3,ctb17,-,ctb4,ctb12,-,ctb6,ctb7,-,ctb1,ctb11,ctb18,ctb13,ctb14,ctb15,ctb16,-,undo,redo,-,ctb8,-,cofi,tsf,visualfilter,icf,cucopy,-,ctb9,-,conf,savesett
-
Branch view;flatview
-
Another entry;<name of the toolbar button>
>>>;
$selected = popupmenu($toolbars, , , , , , <crlf>);
if ($selected) { toolbar($selected); }
else { status "No item chosen, aborted!", "8B4513", "stop"; }