I can't get the simple example copied from the google dev site to work.
The error is: Cannot call FormApp.getUi() from this context
I am NOT attempting to deploy this a web form/app but I am simple trying to run this via the editor!!!
Not sure what I'm doing wrong?!?!?!
The following has been pasted into index.html:
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
Hello, World!
</body>
</html>
The following is pasted into Code.gs:
// Use this code for Google Docs, Forms, or new Sheets.
function onOpen() {
FormApp.getUi()
.createMenu('Dialog')
.addItem('Open', 'openDialog')
.addToUi();
}
function openDialog() {
var html = HtmlService.createHtmlOutputFromFile('Index');
FormApp.getUi()
.showModalDialog(html, 'Dialog title');
}