getSlideByIndex
The index counts from zero. A position past the end gives null rather than an exception, which is what a loop over a deck that someone may be editing needs.
The index comes first and the presentation is optional, the way getSheetByIndex reads: without one the active presentation is used, which is what a script bound to a deck already has. A standalone script has none, and then the answer is null rather than an error.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The zero-based position of the slide. |
|
| The presentation to look in. Without it the active presentation is used. |
Returns
GoogleAppsScript.Slides.Slide | null — the slide, or null when the index is past the end.
Examples
In the active presentation
See also
Source
This documentation was generated with AI (Claude) from the library's source code.