Since my entire Google Doc add-on would be included in a sidebar, I'd like to have it appear by a simple single click on the main menu. However, all examples I see require first clicking the main menu, and then some sort of submenu, e.g. as below.
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('My Add-On')
.addItem('My Add-On sidebar', 'openSidebar')
.addToUi();
}
Instead, I'd like to do something like below, in principle (though it cannot work this way).
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('My Add-On', 'openSidebar') // this doesn't actually work this way
.addToUi();
}
So that the sidebar would open directly when clicking on the main menu.
Is that possible somehow?
(There seems to be some sort of a workaround for Spreadsheets described here, but doesn't seem to apply for Docs.)