Ogólny kreator aktywatorów skryptów.
Metody
Metoda | Zwracany typ | Krótki opis |
---|---|---|
forDocument(document) | DocumentTriggerBuilder | Tworzy i zwraca element DocumentTriggerBuilder powiązany z danym dokumentem. |
forDocument(key) | DocumentTriggerBuilder | Tworzy i zwraca element DocumentTriggerBuilder powiązany z dokumentem o podanym identyfikatorze. |
forForm(form) | FormTriggerBuilder | Tworzy i zwraca obiekt FormTriggerBuilder powiązany z podanym formularzem. |
forForm(key) | FormTriggerBuilder | Tworzy i zwraca obiekt FormTriggerBuilder powiązany z formularzem o podanym identyfikatorze. |
forSpreadsheet(sheet) | SpreadsheetTriggerBuilder | Tworzy i zwraca element SpreadsheetTriggerBuilder powiązany z danym arkuszem kalkulacyjnym. |
forSpreadsheet(key) | SpreadsheetTriggerBuilder | Tworzy i zwraca element SpreadsheetTriggerBuilder powiązany z arkuszem kalkulacyjnym o podanym identyfikatorze. |
forUserCalendar(emailId) | CalendarTriggerBuilder | Zwraca konstruktor do tworzenia aktywatorów kalendarza. |
timeBased() | ClockTriggerBuilder | Tworzy i zwraca wartość ClockTriggerBuilder do tworzenia reguł opartych na czasie. |
Szczegółowa dokumentacja
forDocument(document)
Tworzy i zwraca element DocumentTriggerBuilder
powiązany z danym dokumentem.
ScriptApp.newTrigger('myFunction') .forDocument(DocumentApp.getActiveDocument()) .onOpen() .create();
Parametry
Nazwa | Typ | Opis |
---|---|---|
document | Document | dokument |
Powroty
DocumentTriggerBuilder
– nowa wersja DocumentTriggerBuilder
Upoważnienie
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
forDocument(key)
Tworzy i zwraca element DocumentTriggerBuilder
powiązany z dokumentem o podanym identyfikatorze.
ScriptApp.newTrigger('myFunction') .forDocument('1234567890abcdefghijklmnopqrstuvwxyz') .onOpen() .create();
Parametry
Nazwa | Typ | Opis |
---|---|---|
key | String | identyfikator dokumentu. |
Powroty
DocumentTriggerBuilder
– nowa wersja DocumentTriggerBuilder
Upoważnienie
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
forForm(form)
Tworzy i zwraca obiekt FormTriggerBuilder
powiązany z podanym formularzem.
ScriptApp.newTrigger('myFunction') .forForm(FormApp.getActiveForm()) .onFormSubmit() .create();
Parametry
Nazwa | Typ | Opis |
---|---|---|
form | Form | formularz |
Powroty
FormTriggerBuilder
– nowa wersja FormTriggerBuilder
Upoważnienie
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
forForm(key)
Tworzy i zwraca obiekt FormTriggerBuilder
powiązany z formularzem o podanym identyfikatorze.
ScriptApp.newTrigger('myFunction') .forForm('1234567890abcdefghijklmnopqrstuvwxyz') .onFormSubmit() .create();
Parametry
Nazwa | Typ | Opis |
---|---|---|
key | String | identyfikator formularza |
Powroty
FormTriggerBuilder
– nowa wersja FormTriggerBuilder
Upoważnienie
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
forSpreadsheet(sheet)
Tworzy i zwraca element SpreadsheetTriggerBuilder
powiązany z danym arkuszem kalkulacyjnym.
ScriptApp.newTrigger('myFunction') .forSpreadsheet(SpreadsheetApp.getActive()) .onEdit() .create();
Parametry
Nazwa | Typ | Opis |
---|---|---|
sheet | Spreadsheet | arkusz kalkulacyjny |
Powroty
SpreadsheetTriggerBuilder
– nowa formuła Arkuszy kalkulacyjnych
Upoważnienie
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
forSpreadsheet(key)
Tworzy i zwraca element SpreadsheetTriggerBuilder
powiązany z arkuszem kalkulacyjnym o podanym identyfikatorze.
ScriptApp.newTrigger('myFunction') .forSpreadsheet('1234567890abcdefghijklmnopqrstuvwxyz') .onEdit() .create();
Parametry
Nazwa | Typ | Opis |
---|---|---|
key | String | identyfikator arkusza kalkulacyjnego |
Powroty
SpreadsheetTriggerBuilder
– nowa formuła Arkuszy kalkulacyjnych
Upoważnienie
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
forUserCalendar(emailId)
Zwraca konstruktor do tworzenia aktywatorów kalendarza.
Parametry
Nazwa | Typ | Opis |
---|---|---|
emailId | String | identyfikator e-mail kalendarza użytkownika monitorowanego przez aktywator. |
Powroty
CalendarTriggerBuilder
– nowa usługa CalendarTriggerBuilder.
Upoważnienie
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
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()
Tworzy i zwraca wartość ClockTriggerBuilder
do tworzenia reguł opartych na czasie.
ScriptApp.newTrigger('myFunction') .timeBased() .atDate(2013, 10, 31) .create();
Powroty
ClockTriggerBuilder
– nowa wersja narzędzia ClockTriggerBuilder
Upoważnienie
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.googleapis.com/auth/script.scriptapp