So I have created a G Apps Script and I need to manually install the onEdit trigger. However I ran into an authorization issue, so now I am trying to do it this way. I am following the following suggestionfrom a previously asked StackOverflow question. However when I look into my execution logs, my onOpen runs but I never get a pop up or any ui show up. Please advise how to correctly setup installable onEdit trigger for an editor-addon that utilizes elevated AUTH mode.
function onInstall(e)
{
onOpen(e);
}
function onOpen(e)
{
let ui = SpreadsheetApp.getUi();
ui.createAddonMenu()
.addItem('Please click here to get started', 'addTriggers')
.addToUi();
}
function addTriggers()
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
ScriptApp.newTrigger('myOnEdit')
.forSpreadsheet(ss)
.onEdit()
.create();
}
I figured out my issue, basically the .createAddonMenu()
is not the same as .createMenu()
because the Addon one was hidden and all I had to do was go in there and press it.