AI-generated Key Takeaways
-  The Script service provides access to script triggers and script publishing. 
-  It includes classes for managing authorization modes, statuses, and information. 
-  Various trigger builders are available for specific event types like calendar, clock, document, form, and spreadsheet. 
-  The ScriptApp class allows access to properties like AuthMode, EventType, and TriggerSource, and methods for managing triggers and getting authorization information. 
-  The Service class provides methods to check the status and URL of a published web app. 
This service provides access to script triggers and script publishing.
Classes
| Name | Brief description | 
|---|---|
|  Auth  | An enumeration that identifies which categories of authorized services Apps Script is able to execute through a triggered function. | 
|  Authorization  | An object that checks if the user has granted authorization for the required scopes of the script. | 
|  Authorization  | An enumeration denoting the authorization status of a script. | 
|  Calendar  | Builder for calendar triggers. | 
|  Clock  | A builder for clock triggers. | 
|  Document  | A builder for document triggers. | 
|  Event  | An enumeration denoting the type of triggered event. | 
|  Form  | A builder for form triggers. | 
|  Installation  | An enumeration that indicates how the script came to be installed as an add-on for the current user. | 
|  Script  | Access and manipulate script publishing and triggers. | 
|  Service 
 | Access and manipulate script publishing. | 
|  Spreadsheet  | Builder for spreadsheet triggers. | 
|  State  | Allows scripts to create state tokens that can be used in callback APIs (like OAuth flows). | 
|  Trigger 
 | A script trigger. | 
|  Trigger  | A generic builder for script triggers. | 
|  Trigger  | An enumeration denoting the source of the event that causes the trigger to fire. | 
  Auth  
 
 Properties
| Property | Type | Description | 
|---|---|---|
| NONE | Enum | A mode that does not allow access to any services that require authorization. | 
| CUSTOM_FUNCTION | Enum | A mode that allows access to a limited subset of services for use in custom spreadsheet functions. | 
| LIMITED | Enum | A mode that allows access to a limited subset of services. | 
| FULL | Enum | A mode that allows access to all services that require authorization. | 
  Authorization  
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
|  Authorization  | Gets a value that indicates whether the user needs to authorize this script to use one or more
services (for example, Script ). | |
| String | Gets the authorization URL that can be used to grant access to the script. | |
| String[] | Gets a list of authorized scopes for the script. | 
  Authorization  
 
 Properties
| Property | Type | Description | 
|---|---|---|
| REQUIRED | Enum | The user needs to authorize this script to use one or more services. | 
| NOT_REQUIRED | Enum | The user has granted this script all the authorization it currently requires. | 
  Calendar  
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
|  Trigger 
 | Creates the trigger and returns it. | |
|  Calendar  | Specifies a trigger that fires when a calendar entry is created, updated, or deleted. | 
  Clock  
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
|  Clock  | Specifies the minimum duration (in milliseconds) after the current time that the trigger runs. | |
|  Clock  | Specifies when the trigger runs. | |
|  Clock  | Specifies that the trigger fires on the given date, by default near midnight (+/- 15 minutes). | |
|  Clock  | Specifies the hour the trigger at which the trigger runs. | |
|  Trigger 
 | Creates the trigger. | |
|  Clock  | Specifies to run the trigger every ndays. | |
|  Clock  | Specifies to run the trigger every nhours. | |
|  Clock  | Specifies to run the trigger every nminutes. | |
|  Clock  | Specifies to run the trigger every nweeks. | |
|  Clock  | Specifies the timezone for the specified dates/time when the trigger runs. | |
|  Clock  | Specifies the minute at which the trigger runs (plus or minus 15 minutes). | |
|  Clock  | Specifies the date in the month that the trigger runs. | |
|  Clock  | Specifies the day of the week that the trigger runs. | 
  Document  
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
|  Trigger 
 | Creates and returns the new trigger. | |
|  Document  | Specifies a trigger that will fire when the document is opened. | 
  Event  
 
 Properties
| Property | Type | Description | 
|---|---|---|
| CLOCK | Enum | The trigger fires once the time-driven event reaches a specific time. | 
| ON_OPEN | Enum | The trigger fires once the user opens the Google Docs, Sheets, or Forms file. | 
| ON_EDIT | Enum | The trigger fires once the user edits the Google Sheets file (for example, by entering a new value into a cell, which counts as an edit instead of a change). | 
| ON_FORM_SUBMIT | Enum | The trigger fires once the user responds to a Google Form. | 
| ON_CHANGE | Enum | The trigger fires once the user changes the Google Sheets file (for example, by adding a row, which counts as a change instead of an edit). | 
| ON_EVENT_UPDATED | Enum | The trigger fires once an event gets created, updated, or deleted on the specified Google Calendar. | 
  Form  
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
|  Trigger 
 | Creates and returns the new trigger. | |
|  Form  | Specifies a trigger that will fire when a response is submitted to the form. | |
|  Form  | Specifies a trigger that will fire when the form's edit view is opened. | 
  Installation  
 
 Properties
| Property | Type | Description | 
|---|---|---|
| APPS_MARKETPLACE_DOMAIN_ADD_ON | Enum | Add-on was installed by the administrator for the user's domain. | 
| NONE | Enum | Script is not running as an add-on. | 
| WEB_STORE_ADD_ON | Enum | Add-on was installed by the user from the Chrome Web Store. | 
  Script  
 
 Properties
| Property | Type | Description | 
|---|---|---|
| Auth  |  Auth  | An enumeration that identifies which categories of authorized services Apps Script is able to execute through a triggered function. | 
| Authorization  |  Authorization  | An enumeration denoting the authorization status of a script. | 
| Event  |  Event  | An enumeration denoting the type of triggered event. | 
| Installation  |  Installation  | An enumeration denoting how the script was installed to the user as an add-on. | 
| Trigger  |  Trigger  | An enumeration denoting the source of the event that causes the trigger to fire. | 
| Week  |  Weekday 
 | An enumeration representing the days of the week. | 
Methods
| Method | Return type | Brief description | 
|---|---|---|
| void | Removes the given trigger so it no longer runs. | |
|  Authorization  | Gets an object that checks if the user has granted authorization for all the script requirements. | |
|  Authorization  | Gets an object that checks if the user has granted authorization for the requested scopes. | |
| String | Gets an Open openidscope has been granted. | |
|  Installation  | Returns an enum value that indicates how the script came to be installed as an add-on for the current user (for example, whether the user installed it personally through the Chrome Web Store, or whether a domain administrator installed it for all users). | |
| String | Gets the OAuth 2.0 access token for the effective user. | |
|  Trigger[] 
 | Gets all installable triggers associated with the current project and current user. | |
| String | Gets the script project's unique ID. | |
|  Service 
 | Gets an object used to control publishing the script as a web app. | |
|  Trigger[] 
 | Gets all installable triggers owned by this user in the given document, for this script or add-on only. | |
|  Trigger[] 
 | Gets all installable triggers owned by this user in the given form, for this script or add-on only. | |
|  Trigger[] 
 | Gets all installable triggers owned by this user in the given spreadsheet, for this script or add-on only. | |
| void | Invalidates the authorization the effective user has to execute the current script. | |
|  State  | Creates a builder for a state token that can be used in a callback API (like an OAuth flow). | |
|  Trigger  | Begins the process of creating an installable trigger that, when fired, calls a given function. | |
| void | Validates if the user has granted consent for all of the scopes requested by the script. | |
| void | Validates if the user has granted consent for the requested scopes. | 
  Service 
 
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
| String | Returns the URL of the web app, if it has been deployed; otherwise returns null. | |
| Boolean | Returns trueif the script is accessible as a web app. | 
  Spreadsheet  
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
|  Trigger 
 | Creates the trigger and returns it. | |
|  Spreadsheet  | Specifies a trigger that will fire when the spreadsheet's content or structure is changed. | |
|  Spreadsheet  | Specifies a trigger that will fire when the spreadsheet is edited. | |
|  Spreadsheet  | Specifies a trigger that will fire when the spreadsheet has a form submitted to it. | |
|  Spreadsheet  | Specifies a trigger that will fire when the spreadsheet is opened. | 
  State  
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
| String | Constructs an encrypted string representation of the state token. | |
|  State  | Adds an argument to the token. | |
|  State  | Sets a callback function. | |
|  State  | Sets the duration (in seconds) for which the token is valid. | 
  Trigger 
 
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
|  Event  | Returns the event type that the trigger fires on. | |
| String | Returns the function that will be called when the trigger fires. | |
|  Trigger  | Returns the source of events that will cause the trigger to fire. | |
| String | Returns the id specific to the source. | |
| String | Returns a unique identifier that can be used to distinguish triggers from each other. | 
  Trigger  
 
 Methods
| Method | Return type | Brief description | 
|---|---|---|
|  Document  | Creates and returns a  Document tied to the given document. | |
|  Document  | Creates and returns a  Document tied to the document with the given ID. | |
|  Form  | Creates and returns a  Form tied to the given form. | |
|  Form  | Creates and returns a  Form tied to the form with the given ID. | |
|  Spreadsheet  | Creates and returns a  Spreadsheet tied to the given spreadsheet. | |
|  Spreadsheet  | Creates and returns a  Spreadsheet tied to the spreadsheet with the given
ID. | |
|  Calendar  | Returns a builder for building calendar triggers. | |
|  Clock  | Creates and returns a  Clock for building time-based triggers. | 
  Trigger  
 
 Properties
| Property | Type | Description | 
|---|---|---|
| SPREADSHEETS | Enum | Google Sheets causes the trigger to fire. | 
| CLOCK | Enum | A time-driven event causes the trigger to fire. | 
| FORMS | Enum | Google Forms causes the trigger to fire. | 
| DOCUMENTS | Enum | Google Docs causes the trigger to fire. | 
| CALENDAR | Enum | Google Calendar causes the trigger to fire. | 

