A builder for document triggers.
Methods
Method | Return type | Brief description |
---|---|---|
create() | Trigger | Creates and returns the new trigger. |
onOpen() | DocumentTriggerBuilder | Specifies a trigger that will fire when the document is opened. |
Detailed documentation
create()
onOpen()
Specifies a trigger that will fire when the document is opened.
var document = DocumentApp.getActiveDocument(); ScriptApp.newTrigger('myFunction') .forDocument(document) .onOpen() .create();
Return
DocumentTriggerBuilder
— This DocumentTriggerBuilder
, for chaining.