Base

This service provides access to user information such as email addresses and
user names. It also controls script logs and dialog boxes in Google Workspace applications.

## Classes

| Name | Brief description |
|---|---|
| `https://developers.google.com/apps-script/reference/base/blob` | A data interchange object for Apps Script services. |
| `https://developers.google.com/apps-script/reference/base/blob-source` | Interface for objects that can export their data as a `https://developers.google.com/apps-script/reference/base/blob`. |
| `https://developers.google.com/apps-script/reference/base/browser` | This class provides access to dialog boxes specific to Google Sheets. |
| `https://developers.google.com/apps-script/reference/base/button` | An enum representing predetermined, localized dialog buttons returned by an `https://developers.google.com/apps-script/reference/base/ui#alert(String)` or `https://developers.google.com/apps-script/reference/base/prompt-response#getSelectedButton()` to indicate which button in a dialog the user clicked. |
| `https://developers.google.com/apps-script/reference/base/button-set` | An enum representing predetermined, localized sets of one or more dialog buttons that can be added to an `https://developers.google.com/apps-script/reference/base/ui#alert(String,ButtonSet)` or a `https://developers.google.com/apps-script/reference/base/ui#prompt(String,ButtonSet)`. |
| `https://developers.google.com/apps-script/reference/base/color-type` | The types of Colors |
| `https://developers.google.com/apps-script/reference/base/logger` | This class allows the developer to write to the Execution log and to [Google Cloud Logging](https://cloud.google.com/logging) if the script is associated with a [standard Cloud Project](https://developers.google.com/apps-script/guides/cloud-platform-projects#standard). |
| `https://developers.google.com/apps-script/reference/base/menu` | A custom menu in an instance of the user interface for a Google App. |
| `https://developers.google.com/apps-script/reference/base/mime-type` | An enumeration that provides access to MIME-type declarations without typing the strings explicitly. |
| `https://developers.google.com/apps-script/reference/base/month` | An enum representing the months of the year. |
| `https://developers.google.com/apps-script/reference/base/prompt-response` | A response to a `https://developers.google.com/apps-script/reference/base/ui#prompt(String)` dialog displayed in the user-interface environment for a Google App. |
| `https://developers.google.com/apps-script/reference/base/rgb-color` | A color defined by red, green, blue color channels. |
| `https://developers.google.com/apps-script/reference/base/session` | The Session class provides access to session information, such as the user's email address (in some circumstances) and language setting. |
| `https://developers.google.com/apps-script/reference/base/ui` | An instance of the user-interface environment for a Google App that allows the script to add features like menus, dialogs, and sidebars. |
| `https://developers.google.com/apps-script/reference/base/user` | Representation of a user, suitable for scripting. |
| `https://developers.google.com/apps-script/reference/base/weekday` | An enum representing the days of the week. |
| `https://developers.google.com/apps-script/reference/base/console` | This class allows the developer to write to the Execution log and to [Google Cloud Logging](https://cloud.google.com/logging) if the script is associated with a [standard Cloud Project](https://developers.google.com/apps-script/guides/cloud-platform-projects#standard). |

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

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/blob#copyBlob()` | `https://developers.google.com/apps-script/reference/base/blob` | Returns a copy of this blob. |
| `https://developers.google.com/apps-script/reference/base/blob#getAs(String)` | `https://developers.google.com/apps-script/reference/base/blob` | Return the data inside this object as a blob converted to the specified content type. |
| `https://developers.google.com/apps-script/reference/base/blob#getBytes()` | `Byte[]` | Gets the data stored in this blob. |
| `https://developers.google.com/apps-script/reference/base/blob#getContentType()` | `String|null` | Gets the content type of the bytes in this blob. |
| `https://developers.google.com/apps-script/reference/base/blob#getDataAsString()` | `String` | Gets the data of this blob as a String with UTF-8 encoding. |
| `https://developers.google.com/apps-script/reference/base/blob#getDataAsString(String)` | `String` | Gets the data of this blob as a string with the specified encoding. |
| `https://developers.google.com/apps-script/reference/base/blob#getName()` | `String|null` | Gets the name of this blob. |
| `https://developers.google.com/apps-script/reference/base/blob#isGoogleType()` | `Boolean` | Returns whether this blob is a Google Workspace file (Sheets, Docs, etc.). |
| `https://developers.google.com/apps-script/reference/base/blob#setBytes(Byte)` | `https://developers.google.com/apps-script/reference/base/blob` | Sets the data stored in this blob. |
| `https://developers.google.com/apps-script/reference/base/blob#setContentType(String)` | `https://developers.google.com/apps-script/reference/base/blob` | Sets the content type of the bytes in this blob. |
| `https://developers.google.com/apps-script/reference/base/blob#setContentTypeFromExtension()` | `https://developers.google.com/apps-script/reference/base/blob` | Sets the content type of the bytes in this blob based on the file extension. |
| `https://developers.google.com/apps-script/reference/base/blob#setDataFromString(String)` | `https://developers.google.com/apps-script/reference/base/blob` | Sets the data of this blob from a string with UTF-8 encoding. |
| `https://developers.google.com/apps-script/reference/base/blob#setDataFromString(String,String)` | `https://developers.google.com/apps-script/reference/base/blob` | Sets the data of this blob from a string with the specified encoding. |
| `https://developers.google.com/apps-script/reference/base/blob#setName(String)` | `https://developers.google.com/apps-script/reference/base/blob` | Sets the name of this blob. |

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

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/blob-source#getAs(String)` | `https://developers.google.com/apps-script/reference/base/blob` | Return the data inside this object as a blob converted to the specified content type. |
| `https://developers.google.com/apps-script/reference/base/blob-source#getBlob()` | `https://developers.google.com/apps-script/reference/base/blob` | Return the data inside this object as a blob. |

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

### Properties

| Property | Type | Description |
|---|---|---|
| `Buttons` | `https://developers.google.com/apps-script/reference/base/button-set` |   |

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/browser#inputBox(String)` | `String|null` | Pops up a dialog box with a text input box in the user's browser. |
| `https://developers.google.com/apps-script/reference/base/browser#inputBox(String,ButtonSet)` | `String|null` | Pops up a dialog box with a text input box in the user's browser. |
| `https://developers.google.com/apps-script/reference/base/browser#inputBox(String,String,ButtonSet)` | `String|null` | Pops up a dialog box with a text input box in the user's browser. |
| `https://developers.google.com/apps-script/reference/base/browser#msgBox(String)` | `String|null` | Pops up a dialog box with the given message and an OK button in the user's browser. |
| `https://developers.google.com/apps-script/reference/base/browser#msgBox(String,ButtonSet)` | `String|null` | Pops up a dialog box with the given message and specified buttons in the user's browser. |
| `https://developers.google.com/apps-script/reference/base/browser#msgBox(String,String,ButtonSet)` | `String|null` | Pops up a dialog box with the given title, message and specified buttons in the user's browser. |

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

### Properties

| Property | Type | Description |
|---|---|---|
| `CLOSE` | `Enum` | The standard close button displayed in every dialog's title bar. |
| `OK` | `Enum` | An "OK" button, indicating that an operation should proceed. |
| `CANCEL` | `Enum` | A "Cancel" button, indicating that an operation should not proceed. |
| `YES` | `Enum` | A "Yes" button, indicating a positive response to a question. |
| `NO` | `Enum` | A "No" button, indicating a negative response to a question. |

## `https://developers.google.com/apps-script/reference/base/button-set`

### Properties

| Property | Type | Description |
|---|---|---|
| `OK` | `Enum` | A single "OK" button, indicating an informational message that can only be dismissed. |
| `OK_CANCEL` | `Enum` | An "OK" button and a "Cancel" button, allowing the user to either proceed with or halt an operation. |
| `YES_NO` | `Enum` | A "Yes" button and a "No" button, allowing the user to answer a yes/no question. |
| `YES_NO_CANCEL` | `Enum` | A "Yes" button, a "No" button, and a "Cancel" button, allowing the user to either answer a yes/no question or halt an operation. |

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

### Properties

| Property | Type | Description |
|---|---|---|
| `UNSUPPORTED` | `Enum` | A color type that is not supported. |
| `RGB` | `Enum` | A color defined by red, green, blue color channels. |
| `THEME` | `Enum` | A color that refers to an entry in the theme's color scheme. |

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

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/logger#clear()` | `void` | Clears the log. |
| `https://developers.google.com/apps-script/reference/base/logger#getLog()` | `String` | Returns a complete list of messages in the current log. |
| `https://developers.google.com/apps-script/reference/base/logger#log(Object)` | `https://developers.google.com/apps-script/reference/base/logger` | Writes the data to the log. |
| `https://developers.google.com/apps-script/reference/base/logger#log(String,Object...)` | `https://developers.google.com/apps-script/reference/base/logger` | Writes a formatted string to the logging console, using the format and values provided. |

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

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/menu#addItem(String,String)` | `https://developers.google.com/apps-script/reference/base/menu` | Adds an item to the menu. |
| `https://developers.google.com/apps-script/reference/base/menu#addSeparator()` | `https://developers.google.com/apps-script/reference/base/menu` | Adds a visual separator to the menu. |
| `https://developers.google.com/apps-script/reference/base/menu#addSubMenu(Menu)` | `https://developers.google.com/apps-script/reference/base/menu` | Adds a sub-menu to the menu. |
| `https://developers.google.com/apps-script/reference/base/menu#addToUi()` | `void` | Inserts the menu into the instance of the editor's user interface. |

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

### Properties

| Property | Type | Description |
|---|---|---|
| `GOOGLE_APPS_SCRIPT` | `Enum` | Representation of MIME type for a Google Apps Script project. |
| `GOOGLE_DRAWINGS` | `Enum` | Representation of MIME type for a Google Drawings file. |
| `GOOGLE_DOCS` | `Enum` | Representation of MIME type for a Google Docs file. |
| `GOOGLE_FORMS` | `Enum` | Representation of MIME type for a Google Forms file. |
| `GOOGLE_SHEETS` | `Enum` | Representation of MIME type for a Google Sheets file. |
| `GOOGLE_SITES` | `Enum` | Representation of MIME type for a Google Sites file. |
| `GOOGLE_SLIDES` | `Enum` | Representation of MIME type for a Google Slides file. |
| `FOLDER` | `Enum` | Representation of MIME type for a Google Drive folder. |
| `SHORTCUT` | `Enum` | Representation of MIME type for a Google Drive shortcut. |
| `BMP` | `Enum` | Representation of MIME type for a BMP image file (typically .bmp). |
| `GIF` | `Enum` | Representation of MIME type for a GIF image file (typically .gif). |
| `JPEG` | `Enum` | Representation of MIME type for a JPEG image file (typically .jpg). |
| `PNG` | `Enum` | Representation of MIME type for a PNG image file (typically .png). |
| `SVG` | `Enum` | Representation of MIME type for an SVG image file (typically .svg). |
| `PDF` | `Enum` | Representation of MIME type for a PDF file (typically .pdf). |
| `CSS` | `Enum` | Representation of MIME type for a CSS text file (typically .css). |
| `CSV` | `Enum` | Representation of MIME type for a CSV text file (typically .csv). |
| `HTML` | `Enum` | Representation of MIME type for an HTML text file (typically .html). |
| `JAVASCRIPT` | `Enum` | Representation of MIME type for a JavaScript text file (typically .js). |
| `PLAIN_TEXT` | `Enum` | Representation of MIME type for a plain text file (typically .txt). |
| `RTF` | `Enum` | Representation of MIME type for a rich text file (typically .rtf). |
| `OPENDOCUMENT_GRAPHICS` | `Enum` | Representation of MIME type for an OpenDocument graphics file (typically .odg). |
| `OPENDOCUMENT_PRESENTATION` | `Enum` | Representation of MIME type for an OpenDocument presentation file (typically .odp). |
| `OPENDOCUMENT_SPREADSHEET` | `Enum` | Representation of MIME type for an OpenDocument spreadsheet file (typically .ods). |
| `OPENDOCUMENT_TEXT` | `Enum` | Representation of MIME type for an OpenDocument word-processing file (typically .odt). |
| `MICROSOFT_EXCEL` | `Enum` | Representation of MIME type for a Microsoft Excel spreadsheet file (typically .xlsx). |
| `MICROSOFT_EXCEL_LEGACY` | `Enum` | Representation of MIME type for a Microsoft Excel legacy file (typically .xls). |
| `MICROSOFT_POWERPOINT` | `Enum` | Representation of MIME type for a Microsoft PowerPoint presentation file (typically .pptx). |
| `MICROSOFT_POWERPOINT_LEGACY` | `Enum` | Representation of MIME type for a Microsoft PowerPoint legacy file (typically .ppt). |
| `MICROSOFT_WORD` | `Enum` | Representation of MIME type for a Microsoft Word document file (typically .docx). |
| `MICROSOFT_WORD_LEGACY` | `Enum` | Representation of MIME type for a Microsoft Word legacy file (typically .doc). |
| `ZIP` | `Enum` | Representation of MIME type for a ZIP archive file (typically .zip). |

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

### Properties

| Property | Type | Description |
|---|---|---|
| `JANUARY` | `Enum` | January (month 1). |
| `FEBRUARY` | `Enum` | February (month 2). |
| `MARCH` | `Enum` | March (month 3). |
| `APRIL` | `Enum` | April (month 4). |
| `MAY` | `Enum` | May (month 5). |
| `JUNE` | `Enum` | June (month 6). |
| `JULY` | `Enum` | July (month 7). |
| `AUGUST` | `Enum` | August (month 8). |
| `SEPTEMBER` | `Enum` | September (month 9). |
| `OCTOBER` | `Enum` | October (month 10). |
| `NOVEMBER` | `Enum` | November (month 11). |
| `DECEMBER` | `Enum` | December (month 12). |

## `https://developers.google.com/apps-script/reference/base/prompt-response`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/prompt-response#getResponseText()` | `String` | Gets the text that the user entered in the dialog's input field. |
| `https://developers.google.com/apps-script/reference/base/prompt-response#getSelectedButton()` | `https://developers.google.com/apps-script/reference/base/button` | Gets the button that the user clicked to dismiss the dialog. |

## `https://developers.google.com/apps-script/reference/base/rgb-color`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/rgb-color#asHexString()` | `String` | Returns the color as a CSS-style 7 character hexadecimal string (#rrggbb) or 9 character hexadecimal string (#aarrggbb). |
| `https://developers.google.com/apps-script/reference/base/rgb-color#getBlue()` | `Integer` | The blue channel of this color, as a number from 0 to 255. |
| `https://developers.google.com/apps-script/reference/base/rgb-color#getColorType()` | `https://developers.google.com/apps-script/reference/base/color-type` | Get the type of this color. |
| `https://developers.google.com/apps-script/reference/base/rgb-color#getGreen()` | `Integer` | The green channel of this color, as a number from 0 to 255. |
| `https://developers.google.com/apps-script/reference/base/rgb-color#getRed()` | `Integer` | The red channel of this color, as a number from 0 to 255. |

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

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/session#getActiveUser()` | `https://developers.google.com/apps-script/reference/base/user` | Gets information about the current user. |
| `https://developers.google.com/apps-script/reference/base/session#getActiveUserLocale()` | `String` | Gets the language setting of the current user as a string---for example, `en` for English. |
| `https://developers.google.com/apps-script/reference/base/session#getEffectiveUser()` | `https://developers.google.com/apps-script/reference/base/user` | Gets information about the user under whose authority the script is running. |
| `https://developers.google.com/apps-script/reference/base/session#getScriptTimeZone()` | `String` | Gets the time zone of the script. |
| `https://developers.google.com/apps-script/reference/base/session#getTemporaryActiveUserKey()` | `String` | Gets a temporary key that is unique to the active user but does not reveal the user identity. |

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

### Properties

| Property | Type | Description |
|---|---|---|
| `Button` | `https://developers.google.com/apps-script/reference/base/button` | An enum representing predetermined, localized dialog buttons returned by an [alert](https://developers.google.com/apps-script/reference/base/ui#alert(String)) or `https://developers.google.com/apps-script/reference/base/prompt-response#getSelectedButton()` to indicate which button in a dialog the user clicked. |
| `ButtonSet` | `https://developers.google.com/apps-script/reference/base/button-set` | An enum representing predetermined, localized sets of one or more dialog buttons that can be added to an [alert](https://developers.google.com/apps-script/reference/base/ui#alert(String,ButtonSet)) or a [prompt](https://developers.google.com/apps-script/reference/base/ui#prompt(String,ButtonSet)). |

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/ui#alert(String)` | `https://developers.google.com/apps-script/reference/base/button` | Opens a dialog box in the user's editor with the given message and an "OK" button. |
| `https://developers.google.com/apps-script/reference/base/ui#alert(String,ButtonSet)` | `https://developers.google.com/apps-script/reference/base/button` | Opens a dialog box in the user's editor with the given message and set of buttons. |
| `https://developers.google.com/apps-script/reference/base/ui#alert(String,String,ButtonSet)` | `https://developers.google.com/apps-script/reference/base/button` | Opens a dialog box in the user's editor with the given title, message, and set of buttons. |
| `https://developers.google.com/apps-script/reference/base/ui#createAddonMenu()` | `https://developers.google.com/apps-script/reference/base/menu` | Creates a builder that can be used to insert a sub-menu into the editor's Extensions menu. |
| `https://developers.google.com/apps-script/reference/base/ui#createMenu(String)` | `https://developers.google.com/apps-script/reference/base/menu` | Creates a builder that can be used to add a menu to the editor's user interface. |
| `https://developers.google.com/apps-script/reference/base/ui#prompt(String)` | `https://developers.google.com/apps-script/reference/base/prompt-response` | Opens an input dialog box in the user's editor with the given message and an "OK" button. |
| `https://developers.google.com/apps-script/reference/base/ui#prompt(String,ButtonSet)` | `https://developers.google.com/apps-script/reference/base/prompt-response` | Opens an input dialog box in the user's editor with the given message and set of buttons. |
| `https://developers.google.com/apps-script/reference/base/ui#prompt(String,String,ButtonSet)` | `https://developers.google.com/apps-script/reference/base/prompt-response` | Opens an input dialog box in the user's editor with the given title, message, and set of buttons. |
| `https://developers.google.com/apps-script/reference/base/ui#showModalDialog(Object,String)` | `void` | Opens a modal dialog box in the user's editor with custom client-side content. |
| `https://developers.google.com/apps-script/reference/base/ui#showModelessDialog(Object,String)` | `void` | Opens a modeless dialog box in the user's editor with custom client-side content. |
| `https://developers.google.com/apps-script/reference/base/ui#showSidebar(Object)` | `void` | Opens a sidebar in the user's editor with custom client-side content. |

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

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/user#getEmail()` | `String` | Gets the user's email address, if available. |

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

### Properties

| Property | Type | Description |
|---|---|---|
| `SUNDAY` | `Enum` | Sunday. |
| `MONDAY` | `Enum` | Monday. |
| `TUESDAY` | `Enum` | Tuesday. |
| `WEDNESDAY` | `Enum` | Wednesday. |
| `THURSDAY` | `Enum` | Thursday. |
| `FRIDAY` | `Enum` | Friday. |
| `SATURDAY` | `Enum` | Saturday. |

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

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/base/console#error()` | `void` | Outputs a blank ERROR level message to Stackdriver Logging. |
| `https://developers.google.com/apps-script/reference/base/console#error(Object,Object...)` | `void` | Outputs an ERROR level message to Stackdriver Logging. |
| `https://developers.google.com/apps-script/reference/base/console#info()` | `void` | Outputs blank INFO level message to Stackdriver Logging. |
| `https://developers.google.com/apps-script/reference/base/console#info(Object,Object...)` | `void` | Outputs an INFO level message to Stackdriver Logging. |
| `https://developers.google.com/apps-script/reference/base/console#log()` | `void` | Outputs a blank DEBUG level message to Stackdriver Logging. |
| `https://developers.google.com/apps-script/reference/base/console#log(Object,Object...)` | `void` | Outputs a DEBUG level message to Stackdriver Logging. |
| `https://developers.google.com/apps-script/reference/base/console#time(String)` | `void` | Starts a timer you can use to track how long an operation takes. |
| `https://developers.google.com/apps-script/reference/base/console#timeEnd(String)` | `void` | Stops a timer that was previously started by calling `console.time()`. |
| `https://developers.google.com/apps-script/reference/base/console#warn()` | `void` | Outputs a blank WARNING level message to Stackdriver Logging. |
| `https://developers.google.com/apps-script/reference/base/console#warn(Object,Object...)` | `void` | Outputs a WARNING level message to Stackdriver Logging. |