ListStyle

The list styling for a range of text.

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/slides/list-style#applyListPreset(ListPreset)` | `https://developers.google.com/apps-script/reference/slides/list-style#` | Applies the specified `https://developers.google.com/apps-script/reference/slides/list-preset` to all of the paragraphs that overlap with the text. |
| `https://developers.google.com/apps-script/reference/slides/list-style#getGlyph()` | `String|null` | Returns the rendered glyph for the text. |
| `https://developers.google.com/apps-script/reference/slides/list-style#getList()` | `https://developers.google.com/apps-script/reference/slides/list|null` | Returns the `https://developers.google.com/apps-script/reference/slides/list` the text is in, or `null` if none of the text is in a list, or part of the text is in a list, or the text is in multiple lists. |
| `https://developers.google.com/apps-script/reference/slides/list-style#getNestingLevel()` | `Integer|null` | Returns the 0-based nesting level of the text. |
| `https://developers.google.com/apps-script/reference/slides/list-style#isInList()` | `Boolean|null` | Returns `true` if the text is in exactly one list, `false` if none of the text is in a list, and `null` if only some of the text is in a list or if the text is in multiple lists. |
| `https://developers.google.com/apps-script/reference/slides/list-style#removeFromList()` | `https://developers.google.com/apps-script/reference/slides/list-style#` | Removes the paragraphs that overlap with the text from any lists. |

## Detailed documentation

### `applyListPreset(listPreset)`

Applies the specified `https://developers.google.com/apps-script/reference/slides/list-preset` to all of the paragraphs that overlap with the text.

The nesting level of each paragraph is determined by counting leading tabs in front of each
paragraph. To avoid excess space between the glyphs and the corresponding paragraph, these
leading tabs are removed by this method.

If the paragraph immediately before paragraphs being updated is in a `https://developers.google.com/apps-script/reference/slides/list` with a
matching list preset and the paragraphs being updated are not already in a different list, the

#### Parameters

| Name | Type | Description |
|---|---|---|
| `listPreset` | `https://developers.google.com/apps-script/reference/slides/list-preset` | The list preset to apply. |

#### Return


`https://developers.google.com/apps-script/reference/slides/list-style#` --- This `https://developers.google.com/apps-script/reference/slides/list-style#`, for chaining.

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/presentations.currentonly`
- `https://www.googleapis.com/auth/presentations`

*** ** * ** ***

### `getGlyph()`

Returns the rendered glyph for the text. Returns `null` if the text spans more than one
paragraph or the text is not in a list.

#### Return


`String|null`

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/presentations.currentonly`
- `https://www.googleapis.com/auth/presentations`

*** ** * ** ***

### `getList()`

Returns the `https://developers.google.com/apps-script/reference/slides/list` the text is in, or `null` if none of the text is in a list, or
part of the text is in a list, or the text is in multiple lists. Call `https://developers.google.com/apps-script/reference/slides/list-style#isInList()` to
determine whether the text is in a list.

#### Return


`https://developers.google.com/apps-script/reference/slides/list|null`

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/presentations.currentonly`
- `https://www.googleapis.com/auth/presentations`

*** ** * ** ***

### `getNestingLevel()`

Returns the 0-based nesting level of the text. Returns `null` if the text is not in a
list or there are mixed values.

#### Return


`Integer|null`

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/presentations.currentonly`
- `https://www.googleapis.com/auth/presentations`

*** ** * ** ***

### `isInList()`

Returns `true` if the text is in exactly one list, `false` if none of the text is
in a list, and `null` if only some of the text is in a list or if the text is in multiple
lists.

#### Return


`Boolean|null`

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/presentations.currentonly`
- `https://www.googleapis.com/auth/presentations`

*** ** * ** ***

### `removeFromList()`

Removes the paragraphs that overlap with the text from any lists.

The nesting level of each paragraph is visually preserved by adding indent to the start of

#### Return


`https://developers.google.com/apps-script/reference/slides/list-style#` --- This `https://developers.google.com/apps-script/reference/slides/list-style#`, for chaining.

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/presentations.currentonly`
- `https://www.googleapis.com/auth/presentations`