Class DocumentTriggerBuilder
DocumentTriggerBuilder
Um builder para gatilhos de documentos.
Documentação detalhada
create()
Cria e retorna o novo acionador.
Retornar
Trigger
: o novo acionador.
onOpen()
Especifica um acionador que será acionado quando o documento for aberto.
const document = DocumentApp.getActiveDocument();
ScriptApp.newTrigger('myFunction').forDocument(document).onOpen().create();
Retornar
DocumentTriggerBuilder
: DocumentTriggerBuilder
para encadeamento.
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2024-12-22 UTC.
[null,null,["Última atualização 2024-12-22 UTC."],[[["The DocumentTriggerBuilder helps in creating and managing triggers for Google Docs."],["It provides methods like `create()` to finalize the trigger and `onOpen()` to set a trigger for when the document is opened."],["The `onOpen()` method allows you to specify a function to execute when a document is opened, enhancing document automation capabilities."]]],["The `DocumentTriggerBuilder` class facilitates the creation of triggers for Google Documents. Key actions include `create()`, which generates and returns a new `Trigger` object, and `onOpen()`, which configures the trigger to activate when the document is opened. The `onOpen()` method returns the `DocumentTriggerBuilder` instance, allowing method chaining. The provided example demonstrates creating a trigger that runs \"myFunction\" upon document opening.\n"]]