9

I am adding a custom menu to a spreadsheet and would like to use a hotkey to access the menu. The Alt-F hotkey opens the File pulldown menu. I would like to define Alt-B to activate my pulldown. Is there a way to do this? If so, can I then add hotkeys to the menu items? Here is the code I am using to add the menu:

function onOpen() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();

var BoxwoodMenuItems = [{name : "Payments & Registeration Check-ins", functionName : "htmlRegistrationPayments"},
                       {name: "Assign Billets", functionName: "htmlAssignBillets"},
                       null, // Results in a line separator.
                       {name : "Get Remaining # of Allowed Sent Emails", functionName : "showRemainingEmails"},
                       ];
  sheet.addMenu("Boxwood", BoxwoodMenuItems);
};
Rubén
  • 34,714
  • 9
  • 70
  • 166
Karl_S
  • 3,364
  • 2
  • 19
  • 33
  • custom menus can't currently be assigned a hotkey, but you may want to look at doing a Chrome extension that automatically hit the right arrow button 7 times when ever you hit Alt+F. that'll get you to the script menu – Bryan P May 03 '14 at 02:41
  • Thank you for the response. Too bad I can't assign a hotkey. – Karl_S May 04 '14 at 01:52
  • Or, when you hit alt+f, it then hits the key-command for the menu next/closest to the custom menu, then it likely only needs one or two right-button presses. – aliteralmind Jul 08 '14 at 01:07
  • 1
    There should be accelerator keys for the menu itself, as well as each item in it. This plus the ability to assign key-commands to scripts would make things a lot faster. – aliteralmind Jul 08 '14 at 01:10
  • Possible duplicate of [How to create custom keyboard shortcuts for google app script functions?](https://stackoverflow.com/questions/13731589/how-to-create-custom-keyboard-shortcuts-for-google-app-script-functions) – Rubén Oct 23 '17 at 18:36

2 Answers2

2

At this time it's not possible to set custom keyboard shortcuts / hotkeys Google Docs / Sheets / Forms / Slides for custom menus, but it's possible to do that for Google Sheets Macros.

References

Rubén
  • 34,714
  • 9
  • 70
  • 166
1

Alt-H > Right Arrow > Down Arrow > Enter Works for me without macros ( one Down Arrow for the first custom menu item, two Down Arrow for second and so on.

(That is, Help menu on menubar selected, then your custom menu and then down for your custom functions.)

spcsLrg
  • 340
  • 2
  • 11