Google Docs Custom Menu Hotkey (accelerator key/ch

2019-05-01 04:12发布

问题:

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);
};

回答1:

At this time it's not possible to set custom keyboard shortcuts / hotkeys Google Docs / Sheets / Forms / Slides.

References

  • Official Guides

    • Custom Menus in G Suite
  • Official Issue Tracker

    • Need a support to map shortcut to script functions