Class TriggerBuilder

TriggerBuilder

स्क्रिप्ट ट्रिगर के लिए एक सामान्य बिल्डर.

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
forDocument(document)DocumentTriggerBuilderदिए गए दस्तावेज़ से जुड़ा DocumentTriggerBuilder बनाता है और दिखाता है.
forDocument(key)DocumentTriggerBuilderदिए गए आईडी से दस्तावेज़ से जुड़ा DocumentTriggerBuilder बनाता है और दिखाता है.
forForm(form)FormTriggerBuilderदिए गए फ़ॉर्म से जुड़ा FormTriggerBuilder बनाता है और दिखाता है.
forForm(key)FormTriggerBuilderदिए गए आईडी से फ़ॉर्म से जुड़ा FormTriggerBuilder बनाता है और दिखाता है.
forSpreadsheet(sheet)SpreadsheetTriggerBuilderदी गई स्प्रेडशीट से जुड़ा SpreadsheetTriggerBuilder बनाता है और दिखाता है.
forSpreadsheet(key)SpreadsheetTriggerBuilderदिए गए आईडी की मदद से, स्प्रेडशीट से जुड़ा SpreadsheetTriggerBuilder बनाता है और उसे दिखाता है.
forUserCalendar(emailId)CalendarTriggerBuilderकैलेंडर ट्रिगर बनाने के लिए बिल्डर दिखाता है.
timeBased()ClockTriggerBuilderसमय के हिसाब से ट्रिगर बनाने के लिए, ClockTriggerBuilder बनाता है और दिखाता है.

ज़्यादा जानकारी के साथ दस्तावेज़

forDocument(document)

दिए गए दस्तावेज़ से जुड़ा DocumentTriggerBuilder बनाता है और दिखाता है.

ScriptApp.newTrigger('myFunction')
  .forDocument(DocumentApp.getActiveDocument())
  .onOpen()
  .create();

पैरामीटर

नामTypeब्यौरा
documentDocumentदस्तावेज़

रिटर्न

DocumentTriggerBuilder — नया DocumentTriggerBuilder

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

forDocument(key)

दिए गए आईडी से दस्तावेज़ से जुड़ा DocumentTriggerBuilder बनाता है और दिखाता है.

ScriptApp.newTrigger('myFunction')
  .forDocument('1234567890abcdefghijklmnopqrstuvwxyz')
  .onOpen()
  .create();

पैरामीटर

नामTypeब्यौरा
keyStringदस्तावेज़ का आईडी

रिटर्न

DocumentTriggerBuilder — नया DocumentTriggerBuilder

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

forForm(form)

दिए गए फ़ॉर्म से जुड़ा FormTriggerBuilder बनाता है और दिखाता है.

ScriptApp.newTrigger('myFunction')
  .forForm(FormApp.getActiveForm())
  .onFormSubmit()
  .create();

पैरामीटर

नामTypeब्यौरा
formFormफ़ॉर्म

रिटर्न

FormTriggerBuilder — नया FormsBuilder

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

  • https://www.googleapis.com/auth/forms.currentonly
  • https://www.googleapis.com/auth/forms

forForm(key)

दिए गए आईडी से फ़ॉर्म से जुड़ा FormTriggerBuilder बनाता है और दिखाता है.

ScriptApp.newTrigger('myFunction')
  .forForm('1234567890abcdefghijklmnopqrstuvwxyz')
  .onFormSubmit()
  .create();

पैरामीटर

नामTypeब्यौरा
keyStringफ़ॉर्म का आईडी

रिटर्न

FormTriggerBuilder — नया FormsBuilder

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

  • https://www.googleapis.com/auth/forms.currentonly
  • https://www.googleapis.com/auth/forms

forSpreadsheet(sheet)

दी गई स्प्रेडशीट से जुड़ा SpreadsheetTriggerBuilder बनाता है और दिखाता है.

ScriptApp.newTrigger('myFunction')
  .forSpreadsheet(SpreadsheetApp.getActive())
  .onEdit()
  .create();

पैरामीटर

नामTypeब्यौरा
sheetSpreadsheetस्प्रेडशीट

रिटर्न

SpreadsheetTriggerBuilder — नया स्प्रेडशीटBuilder

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

forSpreadsheet(key)

दिए गए आईडी की मदद से, स्प्रेडशीट से जुड़ा SpreadsheetTriggerBuilder बनाता है और उसे दिखाता है.

ScriptApp.newTrigger('myFunction')
  .forSpreadsheet('1234567890abcdefghijklmnopqrstuvwxyz')
  .onEdit()
  .create();

पैरामीटर

नामTypeब्यौरा
keyStringस्प्रेडशीट के लिए आईडी

रिटर्न

SpreadsheetTriggerBuilder — नया स्प्रेडशीटBuilder

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

forUserCalendar(emailId)

कैलेंडर ट्रिगर बनाने के लिए बिल्डर दिखाता है.

पैरामीटर

नामTypeब्यौरा
emailIdStringउस उपयोगकर्ता कैलेंडर का ईमेल आईडी जिसे ट्रिगर मॉनिटर करता है.

रिटर्न

CalendarTriggerBuilder — नया CalendarTriggerBuilder.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

  • https://www.googleapis.com/auth/calendar
  • https://www.googleapis.com/auth/calendar.readonly
  • https://www.googleapis.com/auth/calendar.events
  • https://www.googleapis.com/auth/calendar.events.readonly
  • https://www.google.com/calendar/feeds

timeBased()

समय के हिसाब से ट्रिगर बनाने के लिए, ClockTriggerBuilder बनाता है और दिखाता है.

ScriptApp.newTrigger('myFunction')
  .timeBased()
  .atDate(2013, 10, 31)
  .create();

रिटर्न

ClockTriggerBuilder — नया ClockTriggerBuilder

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट को, इनमें से एक या ज़्यादा स्कोप से अनुमति देने की ज़रूरत होती है:

  • https://www.googleapis.com/auth/script.scriptapp