I am trying to create an installable onEdit trigger for a spreadsheet bound script. I would like to do this programmatically with a separate, standalone script. It looks like this should be possible according to documentation:
Note that, unlike for a simple onOpen() trigger, the script for the installable trigger does not need to be bound to the spreadsheet. To create this trigger from a standalone script, simply replace SpreadsheetApp.getActive() with a call to SpreadsheetApp.openById(id). https://developers.google.com/apps-script/guides/triggers/installable#managing_triggers_programmatically
However, when I run the code below, the trigger is added to the standalone script project instead of the target, spreadsheet-bound script.
function createSpreadsheetEditTrigger() {
var ss = SpreadsheetApp.openById('1vcAgQ6vPZiILFX0fB_jojyrSdGKr7goD_iCQcFsImEM');
ScriptApp.newTrigger('update')
.forSpreadsheet(ss)
.onEdit()
.create();
}
What am I missing?