Class DocumentTriggerBuilder
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
DocumentTriggerBuilder
יצירת טריגרים למסמכים.
מסמכים מפורטים
create()
יצירת הטריגר החדש והחזרתו.
חזרה
Trigger
— הטריגר החדש.
onOpen()
מציינים טריגר שיופעל כשהמסמך ייפתח.
const document = DocumentApp.getActiveDocument();
ScriptApp.newTrigger('myFunction').forDocument(document).onOpen().create();
חזרה
DocumentTriggerBuilder
— השדה DocumentTriggerBuilder
, לצורך קישור.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[],["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"],null,[]]