Script

This service provides access to script triggers and script publishing.

## Classes

| Name | Brief description |
|---|---|
| `https://developers.google.com/apps-script/reference/script/auth-mode` | An enumeration that identifies which categories of authorized services Apps Script is able to execute through a triggered function. |
| `https://developers.google.com/apps-script/reference/script/authorization-info` | An object that checks if the user has granted authorization for the required scopes of the script. |
| `https://developers.google.com/apps-script/reference/script/authorization-status` | An enumeration denoting the authorization status of a script. |
| `https://developers.google.com/apps-script/reference/script/calendar-trigger-builder` | Builder for calendar triggers. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | A builder for clock triggers. |
| `https://developers.google.com/apps-script/reference/script/document-trigger-builder` | A builder for document triggers. |
| `https://developers.google.com/apps-script/reference/script/event-type` | An enumeration denoting the type of triggered event. |
| `https://developers.google.com/apps-script/reference/script/form-trigger-builder` | A builder for form triggers. |
| `https://developers.google.com/apps-script/reference/script/installation-source` | An enumeration that indicates how the script came to be installed as an add-on for the current user. |
| `https://developers.google.com/apps-script/reference/script/script-app` | Access and manipulate script publishing and triggers. |
| `https://developers.google.com/apps-script/reference/script/service` | Access and manipulate script publishing. |
| `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` | Builder for spreadsheet triggers. |
| `https://developers.google.com/apps-script/reference/script/state-token-builder` | Allows scripts to create state tokens that can be used in callback APIs (like OAuth flows). |
| `https://developers.google.com/apps-script/reference/script/trigger` | A script trigger. |
| `https://developers.google.com/apps-script/reference/script/trigger-builder` | A generic builder for script triggers. |
| `https://developers.google.com/apps-script/reference/script/trigger-source` | An enumeration denoting the source of the event that causes the trigger to fire. |

## `https://developers.google.com/apps-script/reference/script/auth-mode`

### 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. |

## `https://developers.google.com/apps-script/reference/script/authorization-info`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/authorization-info#getAuthorizationStatus()` | `https://developers.google.com/apps-script/reference/script/authorization-status` | Gets a value that indicates whether the user needs to authorize this script to use one or more services (for example, `ScriptApp.AuthorizationStatus.REQUIRED`). |
| `https://developers.google.com/apps-script/reference/script/authorization-info#getAuthorizationUrl()` | `String|null` | Gets the authorization URL that can be used to grant access to the script. |
| `https://developers.google.com/apps-script/reference/script/authorization-info#getAuthorizedScopes()` | `String[]|null` | Gets a list of authorized scopes for the script. |

## `https://developers.google.com/apps-script/reference/script/authorization-status`

### 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. |

## `https://developers.google.com/apps-script/reference/script/calendar-trigger-builder`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/calendar-trigger-builder#create()` | `https://developers.google.com/apps-script/reference/script/trigger` | Creates the trigger and returns it. |
| `https://developers.google.com/apps-script/reference/script/calendar-trigger-builder#onEventUpdated()` | `https://developers.google.com/apps-script/reference/script/calendar-trigger-builder` | Specifies a trigger that fires when a calendar entry is created, updated, or deleted. |

## `https://developers.google.com/apps-script/reference/script/clock-trigger-builder`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#after(Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies the minimum duration (in milliseconds) after the current time that the trigger runs. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#at(Date)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies when the trigger runs. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#atDate(Integer,Integer,Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies that the trigger fires on the given date, by default near midnight (+/- 15 minutes). |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#atHour(Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies the hour the trigger at which the trigger runs. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#create()` | `https://developers.google.com/apps-script/reference/script/trigger` | Creates the trigger. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#everyDays(Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies to run the trigger every `n` days. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#everyHours(Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies to run the trigger every `n` hours. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#everyMinutes(Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies to run the trigger every `n` minutes. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#everyWeeks(Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies to run the trigger every `n` weeks. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#inTimezone(String)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies the timezone for the specified dates/time when the trigger runs. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#nearMinute(Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies the minute at which the trigger runs (plus or minus 15 minutes). |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#onMonthDay(Integer)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies the date in the month that the trigger runs. |
| `https://developers.google.com/apps-script/reference/script/clock-trigger-builder#onWeekDay(Weekday)` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Specifies the day of the week that the trigger runs. |

## `https://developers.google.com/apps-script/reference/script/document-trigger-builder`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/document-trigger-builder#create()` | `https://developers.google.com/apps-script/reference/script/trigger` | Creates and returns the new trigger. |
| `https://developers.google.com/apps-script/reference/script/document-trigger-builder#onOpen()` | `https://developers.google.com/apps-script/reference/script/document-trigger-builder` | Specifies a trigger that fires when the document is opened. |

## `https://developers.google.com/apps-script/reference/script/event-type`

### 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. |

## `https://developers.google.com/apps-script/reference/script/form-trigger-builder`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/form-trigger-builder#create()` | `https://developers.google.com/apps-script/reference/script/trigger` | Creates and returns the new trigger. |
| `https://developers.google.com/apps-script/reference/script/form-trigger-builder#onFormSubmit()` | `https://developers.google.com/apps-script/reference/script/form-trigger-builder` | Specifies a trigger that fires when a response is submitted to the form. |
| `https://developers.google.com/apps-script/reference/script/form-trigger-builder#onOpen()` | `https://developers.google.com/apps-script/reference/script/form-trigger-builder` | Specifies a trigger that fires when the form's edit view is opened. |

## `https://developers.google.com/apps-script/reference/script/installation-source`

### 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. |

## `https://developers.google.com/apps-script/reference/script/script-app`

### Properties

| Property | Type | Description |
|---|---|---|
| `AuthMode` | `https://developers.google.com/apps-script/reference/script/auth-mode` | An enumeration that identifies which categories of authorized services Apps Script is able to execute through a triggered function. |
| `AuthorizationStatus` | `https://developers.google.com/apps-script/reference/script/authorization-status` | An enumeration denoting the authorization status of a script. |
| `EventType` | `https://developers.google.com/apps-script/reference/script/event-type` | An enumeration denoting the type of triggered event. |
| `InstallationSource` | `https://developers.google.com/apps-script/reference/script/installation-source` | An enumeration denoting how the script was installed to the user as an add-on. |
| `TriggerSource` | `https://developers.google.com/apps-script/reference/script/trigger-source` | An enumeration denoting the source of the event that causes the trigger to fire. |
| `WeekDay` | `https://developers.google.com/apps-script/base/weekday.html` | An enumeration representing the days of the week. |

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/script-app#deleteTrigger(Trigger)` | `void` | Removes the given trigger so it no longer runs. |
| `https://developers.google.com/apps-script/reference/script/script-app#getAuthorizationInfo(AuthMode)` | `https://developers.google.com/apps-script/reference/script/authorization-info` | Gets an object that checks if the user has granted authorization for all the script requirements. |
| `https://developers.google.com/apps-script/reference/script/script-app#getAuthorizationInfo(AuthMode,String)` | `https://developers.google.com/apps-script/reference/script/authorization-info` | Gets an object that checks if the user has granted authorization for the requested scopes. |
| `https://developers.google.com/apps-script/reference/script/script-app#getIdentityToken()` | `String|null` | Gets an [OpenID Connect](https://developers.google.com/identity/protocols/OpenIDConnect) identity token for the effective user, if the `openid` scope has been granted. |
| `https://developers.google.com/apps-script/reference/script/script-app#getInstallationSource()` | `https://developers.google.com/apps-script/reference/script/installation-source` | 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). |
| `https://developers.google.com/apps-script/reference/script/script-app#getOAuthToken()` | `String` | Gets the OAuth 2.0 [access token](https://datatracker.ietf.org/doc/html/rfc6749#section-1.4) for the effective user. |
| `https://developers.google.com/apps-script/reference/script/script-app#getProjectTriggers()` | `https://developers.google.com/apps-script/reference/script/trigger` | Gets all installable triggers associated with the current project and current user. |
| `https://developers.google.com/apps-script/reference/script/script-app#getScriptId()` | `String` | Gets the script project's unique ID. |
| `https://developers.google.com/apps-script/reference/script/script-app#getService()` | `https://developers.google.com/apps-script/reference/script/service` | Gets an object used to control publishing the script as a web app. |
| `https://developers.google.com/apps-script/reference/script/script-app#getUserTriggers(Document)` | `https://developers.google.com/apps-script/reference/script/trigger` | Gets all installable triggers owned by this user in the given document, for this script or add-on only. |
| `https://developers.google.com/apps-script/reference/script/script-app#getUserTriggers(Form)` | `https://developers.google.com/apps-script/reference/script/trigger` | Gets all installable triggers owned by this user in the given form, for this script or add-on only. |
| `https://developers.google.com/apps-script/reference/script/script-app#getUserTriggers(Spreadsheet)` | `https://developers.google.com/apps-script/reference/script/trigger` | Gets all installable triggers owned by this user in the given spreadsheet, for this script or add-on only. |
| `https://developers.google.com/apps-script/reference/script/script-app#invalidateAuth()` | `void` | Invalidates the authorization the effective user has to execute the current script. |
| `https://developers.google.com/apps-script/reference/script/script-app#newStateToken()` | `https://developers.google.com/apps-script/reference/script/state-token-builder` | Creates a builder for a state token that can be used in a callback API (like an OAuth flow). |
| `https://developers.google.com/apps-script/reference/script/script-app#newTrigger(String)` | `https://developers.google.com/apps-script/reference/script/trigger-builder` | Begins the process of creating an installable trigger that, when fired, calls a given function. |
| `https://developers.google.com/apps-script/reference/script/script-app#requireAllScopes(AuthMode)` | `void` | Validates if the user has granted consent for all of the scopes requested by the script. |
| `https://developers.google.com/apps-script/reference/script/script-app#requireScopes(AuthMode,String)` | `void` | Validates if the user has granted consent for the requested scopes. |

## `https://developers.google.com/apps-script/reference/script/service`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/service#getUrl()` | `String` | Returns the URL of the web app, if it has been deployed; otherwise returns `null`. |
| `https://developers.google.com/apps-script/reference/script/service#isEnabled()` | `Boolean` | Returns `true` if the script is accessible as a web app. |

## `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder#create()` | `https://developers.google.com/apps-script/reference/script/trigger` | Creates the trigger and returns it. |
| `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder#onChange()` | `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` | Specifies a trigger that fires when the spreadsheet's content or structure is changed. |
| `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder#onEdit()` | `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` | Specifies a trigger that fires when the spreadsheet is edited. |
| `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder#onFormSubmit()` | `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` | Specifies a trigger that fires when the spreadsheet has a form submitted to it. |
| `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder#onOpen()` | `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` | Specifies a trigger that fires when the spreadsheet is opened. |

## `https://developers.google.com/apps-script/reference/script/state-token-builder`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/state-token-builder#createToken()` | `String` | Constructs an encrypted string representation of the state token. |
| `https://developers.google.com/apps-script/reference/script/state-token-builder#withArgument(String,String)` | `https://developers.google.com/apps-script/reference/script/state-token-builder` | Adds an argument to the token. |
| `https://developers.google.com/apps-script/reference/script/state-token-builder#withMethod(String)` | `https://developers.google.com/apps-script/reference/script/state-token-builder` | Sets a callback function. |
| `https://developers.google.com/apps-script/reference/script/state-token-builder#withTimeout(Integer)` | `https://developers.google.com/apps-script/reference/script/state-token-builder` | Sets the duration (in seconds) for which the token is valid. |

## `https://developers.google.com/apps-script/reference/script/trigger`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/trigger#getEventType()` | `https://developers.google.com/apps-script/reference/script/event-type` | Returns the event type that the trigger fires on. |
| `https://developers.google.com/apps-script/reference/script/trigger#getHandlerFunction()` | `String` | Returns the function that is called when the trigger fires. |
| `https://developers.google.com/apps-script/reference/script/trigger#getTriggerSource()` | `https://developers.google.com/apps-script/reference/script/trigger-source` | Returns the source of events that causes the trigger to fire. |
| `https://developers.google.com/apps-script/reference/script/trigger#getTriggerSourceId()` | `String` | Returns the id specific to the source. |
| `https://developers.google.com/apps-script/reference/script/trigger#getUniqueId()` | `String` | Returns a unique identifier that can be used to distinguish triggers from each other. |

## `https://developers.google.com/apps-script/reference/script/trigger-builder`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/script/trigger-builder#forDocument(Document)` | `https://developers.google.com/apps-script/reference/script/document-trigger-builder` | Creates and returns a `https://developers.google.com/apps-script/reference/script/document-trigger-builder` tied to the given document. |
| `https://developers.google.com/apps-script/reference/script/trigger-builder#forDocument(String)` | `https://developers.google.com/apps-script/reference/script/document-trigger-builder` | Creates and returns a `https://developers.google.com/apps-script/reference/script/document-trigger-builder` tied to the document with the given ID. |
| `https://developers.google.com/apps-script/reference/script/trigger-builder#forForm(Form)` | `https://developers.google.com/apps-script/reference/script/form-trigger-builder` | Creates and returns a `https://developers.google.com/apps-script/reference/script/form-trigger-builder` tied to the given form. |
| `https://developers.google.com/apps-script/reference/script/trigger-builder#forForm(String)` | `https://developers.google.com/apps-script/reference/script/form-trigger-builder` | Creates and returns a `https://developers.google.com/apps-script/reference/script/form-trigger-builder` tied to the form with the given ID. |
| `https://developers.google.com/apps-script/reference/script/trigger-builder#forSpreadsheet(Spreadsheet)` | `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` | Creates and returns a `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` tied to the given spreadsheet. |
| `https://developers.google.com/apps-script/reference/script/trigger-builder#forSpreadsheet(String)` | `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` | Creates and returns a `https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder` tied to the spreadsheet with the given ID. |
| `https://developers.google.com/apps-script/reference/script/trigger-builder#forUserCalendar(String)` | `https://developers.google.com/apps-script/reference/script/calendar-trigger-builder` | Returns a builder for building calendar triggers. |
| `https://developers.google.com/apps-script/reference/script/trigger-builder#timeBased()` | `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` | Creates and returns a `https://developers.google.com/apps-script/reference/script/clock-trigger-builder` for building time-based triggers. |

## `https://developers.google.com/apps-script/reference/script/trigger-source`

### 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. |