スクリプト トリガーの汎用ビルダー。
メソッド
| メソッド | 戻り値の型 | 概要 | 
|---|---|---|
for | Document | 指定されたドキュメントに関連付けられた Document を作成して返します。 | 
for | Document | 指定された ID のドキュメントに関連付けられた Document を作成して返します。 | 
for | Form | 指定されたフォームに関連付けられた Form を作成して返します。 | 
for | Form | 指定された ID のフォームに関連付けられた Form を作成して返します。 | 
for | Spreadsheet | 指定されたスプレッドシートに関連付けられた Spreadsheet を作成して返します。 | 
for | Spreadsheet | 指定された ID のスプレッドシートに関連付けられた Spreadsheet を作成して返します。 | 
for | Calendar | カレンダー トリガーを作成するためのビルダーを返します。 | 
time | Clock | 時間ベースのトリガーを構築するための Clock を作成して返します。 | 
詳細なドキュメント
for Document(document)
指定されたドキュメントに関連付けられた Document を作成して返します。
ScriptApp .newTrigger('myFunction') .forDocument(DocumentApp.getActiveDocument()) .onOpen() .create();
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
document | Document | ドキュメント | 
戻る
Document - 新しい DocumentTriggerBuilder
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.googleapis.com/auth/documents.currentonly - 
https://www.googleapis.com/auth/documents 
for Document(key)
指定された ID のドキュメントに関連付けられた Document を作成して返します。
ScriptApp .newTrigger('myFunction') .forDocument('1234567890abcdefghijklmnopqrstuvwxyz') .onOpen() .create();
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
key | String | ドキュメントの ID | 
戻る
Document - 新しい DocumentTriggerBuilder
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.googleapis.com/auth/documents.currentonly - 
https://www.googleapis.com/auth/documents 
for Form(form)
指定されたフォームに関連付けられた Form を作成して返します。
ScriptApp .newTrigger('myFunction') .forForm(FormApp.getActiveForm()) .onFormSubmit() .create();
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
form | Form | フォーム | 
戻る
Form - 新しい FormTriggerBuilder
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.googleapis.com/auth/forms.currentonly - 
https://www.googleapis.com/auth/forms 
for Form(key)
指定された ID のフォームに関連付けられた Form を作成して返します。
ScriptApp .newTrigger('myFunction') .forForm('1234567890abcdefghijklmnopqrstuvwxyz') .onFormSubmit() .create();
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
key | String | フォームの ID | 
戻る
Form - 新しい FormTriggerBuilder
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.googleapis.com/auth/forms.currentonly - 
https://www.googleapis.com/auth/forms 
for Spreadsheet(sheet)
指定されたスプレッドシートに関連付けられた Spreadsheet を作成して返します。
ScriptApp .newTrigger('myFunction') .forSpreadsheet(SpreadsheetApp.getActive()) .onEdit() .create();
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
sheet | Spreadsheet | スプレッドシート | 
戻る
Spreadsheet - 新しい SpreadsheetTriggerBuilder
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.googleapis.com/auth/spreadsheets.currentonly - 
https://www.googleapis.com/auth/spreadsheets 
for Spreadsheet(key)
指定された ID のスプレッドシートに関連付けられた Spreadsheet を作成して返します。
ScriptApp .newTrigger('myFunction') .forSpreadsheet('1234567890abcdefghijklmnopqrstuvwxyz') .onEdit() .create();
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
key | String | スプレッドシートの ID | 
戻る
Spreadsheet - 新しい SpreadsheetTriggerBuilder
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.googleapis.com/auth/spreadsheets.currentonly - 
https://www.googleapis.com/auth/spreadsheets 
for User Calendar(emailId)
カレンダー トリガーを作成するためのビルダーを返します。
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
email | String | トリガーがモニタリングするユーザー カレンダーのメール ID。 | 
戻る
Calendar - 新しい CalendarTriggerBuilder。
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
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 
time Based()
時間ベースのトリガーを構築するための Clock を作成して返します。
ScriptApp .newTrigger('myFunction').timeBased().atDate(2013, 10, 31).create();
戻る
Clock - 新しい ClockTriggerBuilder
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.googleapis.com/auth/script.scriptapp