Class NotesPage

  • Notes pages in a presentation contain content for handouts, including a shape for speaker notes.

  • Each slide in a presentation has a corresponding notes page.

  • Only the text within the speaker notes shape on a notes page can be modified.

  • Notes pages provide methods to retrieve various page elements like groups, images, lines, shapes, charts, tables, videos, and word art.

  • You can find a specific page element by its ID or retrieve placeholder elements by type and index on a notes page.

  • Text on a notes page can be replaced using thereplaceAllText method, with an option for case-sensitive matching.

NotesPage

A notes page in a presentation.

These pages contain the content for presentation handouts, including a a shape that containsthe slide's speaker notes. Each slide has one corresponding notes page. Only the text in thespeaker notes shape can be modified.

Methods

MethodReturn typeBrief description
getGroups()Group[]Returns the list ofGroup objects on the page.
getImages()Image[]Returns the list ofImage objects on the page.
getLines()Line[]Returns the list ofLine objects on the page.
getObjectId()StringGets the unique ID for the page.
getPageElementById(id)PageElement|nullReturns thePageElement on the page with the given ID, ornull if none exists.
getPageElements()PageElement[]Returns the list ofPageElement objects rendered on the page.
getPlaceholder(placeholderType)PageElement|nullReturns the placeholderPageElement object for a specifiedPlaceholderType ornull if a matching placeholder is not present.
getPlaceholder(placeholderType, placeholderIndex)PageElement|nullReturns the placeholderPageElement object for a specifiedPlaceholderType anda placeholder index, ornull if the placeholder is not present.
getPlaceholders()PageElement[]Returns the list of placeholderPageElement objects in the page.
getShapes()Shape[]Returns the list ofShape objects on the page.
getSheetsCharts()SheetsChart[]Returns the list ofSheetsChart objects on the page.
getSpeakerNotesShape()ShapeGets the shape containing the speaker notes on the page.
getTables()Table[]Returns the list ofTable objects on the page.
getVideos()Video[]Returns the list ofVideo objects on the page.
getWordArts()WordArt[]Returns the list ofWordArt objects on the page.
replaceAllText(findText, replaceText)IntegerReplaces all instances of text matching find text with replace text.
replaceAllText(findText, replaceText, matchCase)IntegerReplaces all instances of text matching find text with replace text.

Detailed documentation

getGroups()

Returns the list ofGroup objects on the page.

Return

Group[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getImages()

Returns the list ofImage objects on the page.

Return

Image[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getLines()

Returns the list ofLine objects on the page.

Return

Line[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getObjectId()

Gets the unique ID for the page. Object IDs used by pages and page elements share the samenamespace.

Return

String

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getPageElementById(id)

Returns thePageElement on the page with the given ID, ornull if none exists.

Parameters

NameTypeDescription
idStringThe ID of the page element that is being retrieved.

Return

PageElement|null — The page element with the given ID.

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getPageElements()

Returns the list ofPageElement objects rendered on the page.

Return

PageElement[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getPlaceholder(placeholderType)

Returns the placeholderPageElement object for a specifiedPlaceholderType ornull if a matching placeholder is not present.

If there are multiple placeholders with the same type, it returns the one with minimalplaceholder index. If there are multiple matching placeholders with the same index, it returnsthe first placeholder from the page's page elements collection.

constslide=SlidesApp.getActivePresentation().getSlides()[0];constplaceholder=slide.getPlaceholder(SlidesApp.PlaceholderType.CENTERED_TITLE,);

Parameters

NameTypeDescription
placeholderTypePlaceholderType

Return

PageElement|null

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getPlaceholder(placeholderType, placeholderIndex)

Returns the placeholderPageElement object for a specifiedPlaceholderType anda placeholder index, ornull if the placeholder is not present.

If there are multiple placeholders with the same type and index, it returns the firstplaceholder from the page's page elements collection.

constslide=SlidesApp.getActivePresentation().getSlides()[0];constplaceholder=slide.getPlaceholder(SlidesApp.PlaceholderType.CENTERED_TITLE,0,);

Parameters

NameTypeDescription
placeholderTypePlaceholderType
placeholderIndexInteger

Return

PageElement|null

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getPlaceholders()

Returns the list of placeholderPageElement objects in the page.

constmaster=SlidesApp.getActivePresentation().getMasters()[0];Logger.log(`Number of placeholders in the master:${master.getPlaceholders().length}`,);

Return

PageElement[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getShapes()

Returns the list ofShape objects on the page.

Return

Shape[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getSheetsCharts()

Returns the list ofSheetsChart objects on the page.

Return

SheetsChart[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getSpeakerNotesShape()

Gets the shape containing the speaker notes on the page.

Return

Shape

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getTables()

Returns the list ofTable objects on the page.

Return

Table[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getVideos()

Returns the list ofVideo objects on the page.

Return

Video[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getWordArts()

Returns the list ofWordArt objects on the page.

Return

WordArt[]

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

replaceAllText(findText, replaceText)

Replaces all instances of text matching find text with replace text. The search is caseinsensitive.

Parameters

NameTypeDescription
findTextStringThe text to find.
replaceTextStringThe text to replace the matched text.

Return

Integer — the number of occurrences changed

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

replaceAllText(findText, replaceText, matchCase)

Replaces all instances of text matching find text with replace text.

Parameters

NameTypeDescription
findTextStringThe text to find.
replaceTextStringThe text to replace the matched text.
matchCaseBooleanIftrue, the search is case sensitive; iffalse, the search is case insensitive.

Return

Integer — the number of occurrences changed

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.