On Windows, any button on the quick-access toolbar is automatically assigned a keyboard shortcut of the form Alt+1
, Alt+2
, Alt+3
etc., so if you place your script in a shortcut on the toolbar, it will have this associated keyboard shortcut, which can be viewed by pressing Alt
.
This does not allow you to customize the key binding (besides the number, which is simply the button's location on the toolbar, from left to right), but it does provide for a handy way to run custom scripts with a simple keyboard shortcut.
Note also that any custom shortcut can also be accessed by pressing Alt+S
and then the shortcut number as it appears in the shortcuts tab.
I am yet to find a solution for MATLAB on macOS.