Is there any way we can create menu items in Google Sheets through “non-bound” scripts? I read some official documentation on getUI, but found nothing so far in regards to non-bound scripts. The following was my initial attempt, but no menu item is generating on my Google Sheet…
function onOpen() {
const id = "1AHHRp0YNltB...";
const sheet = SpreadsheetApp.openById(id);
const tab = sheet.getSheetByName("results");
const menu = sheet.getUi();
menu.createMenu("send email").addItem("Approve", "approver").addToUi();
function appover() {
const id = "1AHHRp0YNltB...";
const sheet = SpreadsheetApp.openById(id);
const menu = sheet.getUi();
const res = menu.alert("Okay?", menu.ButtonSet.YES_NO);
}
}