I want to create an installable trigger for googlesheets and here is the Apps Script code that creates it:
function setTrigger() {
var ss = SpreadsheetApp.getActive();
ScriptApp.newTrigger("myFunction").forSpreadsheet(ss).onEdit().create();
}
function myFunction() {
Logger.log('x');
}
When I run the function setTrigger() from Apps Script, I get the exception:
Exception: Unexpected error while getting the method or property forSpreadsheet on object ScriptApp.TriggerBuilder.setTrigger