apps-script-utils 2.1.1 Help

getSlideIndex

function getSlideIndex( slide: GoogleAppsScript.Slides.Slide, presentation?: GoogleAppsScript.Slides.Presentation | null ): number | null;

The slides are compared by their object id, so a slide read earlier is still recognised. A slide that belongs to another presentation, or has since been removed, gives null.

The slide comes first and the presentation is optional, the way getSlideByIndex and getSheetByIndex read: 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

slide

GoogleAppsScript.Slides.Slide

The slide to look for.

presentation (optional)

GoogleAppsScript.Slides.Presentation \| null

The presentation to look in. Without it the active presentation is used.

Returns

number | null — the zero-based position, or null when the slide is not there.

Examples

In the active presentation

const slide = SlidesApp.getActivePresentation().getSlides()[2]; getSlideIndex(slide); // => 2

See also

Source

src/appsscript/slide/getSlideIndex.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.