[GAS Beginner Series #73] Auto-Add Speaker Notes to Google Slides: How to Use Slide.getNotesPage()

In our previous session (Part 72), we explored how to iterate through every slide in a presentation using Presentation.getSlides() to perform batch operations!

No matter how many slides you have, running a script lets you scan through them in an instant, giving you a solid foundation for automating Google Slides presentations.

In Part 73, we are diving into a super-practical method that will take your presentation automation to the next level: Slide.getNotesPage()!

During an actual presentation, you often want to keep only the key takeaways on the screen while keeping detailed speaking scripts and anticipated Q&A notes in your presenter notes. It’s a very common requirement, right?

However, manually copying and pasting talk tracks into the speaker notes of dozens of slides is tedious and exhausting work…

In this guide, we will automate speaker notes insertion for executive reviews and internal reporting by building practical code that automatically populates oral scripts for an executive presentation at our Sapporo Office.

From the underlying structure and step-by-step instructions to common beginner pitfalls, we’ll walk through everything clearly and thoroughly. Let’s dive in together!

1. What Is Slide.getNotesPage() in Google Apps Script?

Slide.getNotesPage() is a method used to retrieve the speaker notes page (NotesPage object) associated with a specific slide (Slide object).

In Google Slides, the speaker notes section located at the bottom of the interface is internally managed in Google Apps Script as an independent “notes page.”

Think of It as “The Stage and The Green Room”

Let’s organize the mental model using an easy analogy:

  • [The Venue / Theater] = The Entire Presentation (SlidesApp.openById())
  • [The Stage] = The Slide (Slide)
  • [The Backstage Green Room / Script Notes] = The Notes Page (NotesPage) ★ Our main topic!

If the slide itself is the public stage shown to the audience, the NotesPage is the behind-the-scenes script accessible only to the presenter.

The 4 Steps to Writing Text into Speaker Notes

Unlike Google Sheets operations like Sheet.getRange().setValue(), writing text into Google Slides speaker notes requires navigating through four hierarchical steps in order.

StepTarget ObjectPrimary MethodReal-World Analogy
STEP 1Slidepresentation.getSlides()[0]Select the first “stage”
STEP 2Notes Pageslide.getNotesPage()Open that stage’s “backstage notebook”
STEP 3Text Box (Shape)notesPage.getSpeakerNotesShape()Locate the “script area” inside the notebook
STEP 4Text Rangeshape.getText().setText(...)Write the script into the area using a pen

It might feel like quite a few steps at first, but don’t worry—chaining them together with dots (.) makes it clean and straightforward!

2. STEP 1: Preparation! Create the Executive Presentation Deck

First, let’s prepare a practice Google Slides deck to control via GAS.

Setup Steps

  1. Open Google Drive, click “New”, and create a new Google Slides presentation (not a Spreadsheet).
  2. Change the presentation title in the upper left to “Sapporo Office Monthly Performance Report”.
  3. Add slides so that you have 3 slides in total (use the “+” button or press Ctrl + M).
  4. In the title box of each slide, enter the following titles to keep them clear:
    • Slide 1: Sapporo Office Monthly Performance Report (Overview)
    • Slide 2: Sapporo Station & Odori Stores Regional Sales Performance
    • Slide 3: Summary of This Term & Next Term Outlook
  5. Copy the Presentation ID from your browser’s URL bar.

💡 How to Find Your Presentation ID

The ID is the long alphanumeric string located between /d/ and /edit in the URL.

https://docs.google.com/presentation/d/ 1a2b3c4d5e6f... /edit

3. STEP 2: Hands-On: Add Speaking Notes to a Specific Slide

Now that our deck is ready, let’s write a GAS script to automatically insert an executive meeting script into the speaker notes of the first slide!

1. Enter the Code

Open a standalone GAS project, a linked spreadsheet, or go directly to “Extensions” > “Apps Script” inside your slide deck, then paste the following code:

* Replace YOUR_PRESENTATION_ID with the presentation ID you copied earlier.

function addSpeakerNoteToFirstSlide() {
  // 1. Open the presentation by ID (see Part 61)
  var presentationId = "YOUR_PRESENTATION_ID";
  var presentation = SlidesApp.openById(presentationId);
  
  // 2. Get the first slide (Index: 0)
  var slides = presentation.getSlides();
  var firstSlide = slides[0];
  
  // 3. Get the NotesPage object from the first slide
  var notesPage = firstSlide.getNotesPage();
  
  // 4. Get the speaker notes text frame (Shape) on the notes page
  var speakerNotesShape = notesPage.getSpeakerNotesShape();
  
  // 5. Compose the script text
  var scriptText = "[Executive Script]\n" +
                   "- After opening remarks, emphasize that the Sapporo Office exceeded its monthly target at 120%.\n" +
                   "- Verbally highlight that the Sapporo Soup Curry takeout division contributed significantly at 150% YoY.";
  
  // 6. Write to the text frame (setText)
  speakerNotesShape.getText().setText(scriptText);
  
  // 7. Output log to verify (see Part 1)
  Logger.log("Speaker notes successfully added to the first slide!");
}

2. Line-by-Line Code Breakdown

  • var notesPage = firstSlide.getNotesPage();
    Retrieves the NotesPage object containing presenter notes from the first slide.
  • var speakerNotesShape = notesPage.getSpeakerNotesShape();
    Finds the specific text box (Shape) on the notes page designated for speaker notes.
  • speakerNotesShape.getText().setText(scriptText);
    Uses getText() to obtain the TextRange object and calls .setText() to overwrite it with your script.

3. Save and Run the Function

  1. Click Save (the disk icon) at the top of the editor.
  2. Make sure the selected function is addSpeakerNoteToFirstSlide, then click Run.
  3. If this is your first run, an authorization prompt will appear. Review and grant permissions (refer to Part 2 for authorization steps).

[Verifying Execution Results]

Switch back to your Google Slides tab!

If the “Speaker notes” panel at the bottom of the first slide is instantly filled with the text starting with [Executive Script], you’ve succeeded!

4. STEP 3: Advanced Automation: Batch-Insert Speaker Notes Across All Slides

Writing to a single slide is helpful, but the real power of GAS lies in bulk automation!

In business scenarios, you often maintain slide scripts in a predefined list (such as an array or a Google Sheet) and batch-inject them across all slides in one shot.

By combining the getSlides() loop from Part 72 with our notes logic, let’s insert oral scripts across all three slides at once!

Sample Code for Batch Insertion

function addAllSpeakerNotes() {
  var presentationId = "YOUR_PRESENTATION_ID";
  var presentation = SlidesApp.openById(presentationId);
  
  // Get all slides in the deck (see Part 72)
  var slides = presentation.getSlides();
  
  // Prepare an array of talk tracks for each slide
  var speechScripts = [
    "[Slide 1 Script] Thank you everyone for your time today. I will now present the Sapporo Office monthly performance report. We achieved 120% of our target this term, maintaining strong momentum.",
    "[Slide 2 Script] Here is the regional breakdown. The Sapporo Station store reached 115% sales driven by tourist traffic. The Odori store hit an all-time high of 125% sales thanks to local repeat customers.",
    "[Slide 3 Script] In conclusion, we are planning a pop-up store in the New Chitose Airport area next term. We look forward to your review and feedback."
  ];
  
  // Loop through slides and populate notes sequentially
  for (var i = 0; i < slides.length; i++) {
    var slide = slides[i];
    var script = speechScripts[i];
    
    // Retrieve the notes page and insert text
    var notesPage = slide.getNotesPage();
    var speakerNotesShape = notesPage.getSpeakerNotesShape();
    
    // Write the script
    speakerNotesShape.getText().setText(script);
    
    Logger.log("Inserted speaker notes for slide " + (i + 1));
  }
  
  Logger.log("All speaker notes inserted successfully!");
}

Execution Results

Run the code, and within a second or two, every single slide will have its corresponding talk track added to the presenter notes area!

By reading talk tracks dynamically from Google Sheets or databases, your reporting workflow becomes vastly faster and error-free.

5. 5 Common Pitfalls with Slide.getNotesPage() and How to Fix Them

Here are five frequent stumbling blocks beginners encounter when working with Slide.getNotesPage(), along with clear troubleshooting tips.

Keep these in mind to save debugging time!

Pitfall 1: Calling slide.setText() and Triggering a TypeError

A very frequent mistake is attempting to call setText() directly on the Slide object.

// Incorrect (You cannot call setText directly on a Slide)
slide.setText("Script text"); 

// Correct (Traverse down to TextRange)
slide.getNotesPage().getSpeakerNotesShape().getText().setText("Script text");

The slide (the stage) and the notes page (backstage notes) are distinct entities. Always step through getNotesPage() ➡ getSpeakerNotesShape() ➡ getText().

Pitfall 2: setText() Overwrites Existing Notes Completely

setText() completely replaces the content of the target text box. If you run setText() on a slide that already contains manual notes, the existing content will be erased!

[Fix: Appending Text to Existing Notes]

If you want to keep existing content and append new text to the end, use .appendText() or .appendParagraph() instead.

// Append to existing notes with a newline
speakerNotesShape.getText().appendText("\n[Addendum] Anticipate questions regarding gross margin during Q&A.");

Pitfall 3: getSpeakerNotesShape() Returns null

On rare occasions—such as when using customized or imported templates where the default notes shape has been deleted—getSpeakerNotesShape() may return null.

Standard Google Slides layouts include this shape by default, but adding a null check ensures bulletproof execution:

var shape = notesPage.getSpeakerNotesShape();
if (shape) {
  shape.getText().setText("Script");
}

Pitfall 4: Trying to Use setNote() Like in SpreadsheetApp

In Google Sheets, we used Range.setNote() (see Part 40) to add notes to cells.

However, Google Slides speaker notes do not use setNote(). Instead, the path is getNotesPage().getSpeakerNotesShape().getText().setText().

Remember: in Google Slides, notes live inside an actual shape on a dedicated page!

Pitfall 5: Malformed Presentation ID or Permission Errors

Pasting the entire URL into SlidesApp.openById("ID") or forgetting surrounding double quotes can cause runtime errors or a SyntaxError.

Double-check that only the alphanumeric ID from the middle of the URL is passed to the method.

6. Summary and What’s Coming Next

In this tutorial, we covered how to automatically populate speaker notes and presentation scripts using Slide.getNotesPage() in Google Apps Script!

Quick Recap of Key Points

  1. Use Slide.getNotesPage() to retrieve the slide’s associated NotesPage object.
  2. Use notesPage.getSpeakerNotesShape() to target the speaker notes text frame.
  3. Use shape.getText().setText() to overwrite notes, or appendText() to append.
  4. Combine with a getSlides() loop to automate presentation notes across an entire deck!

Automatically loading talking points and supplementary figures into speaker notes helps presenters deliver polished briefings without missing key points.

Coming Up Next!

In Part 74, we will dive into precision layout controls using PageElement.setLeft() / setTop() to position shapes, charts, and tables down to the millimeter!

We’ll tackle an advanced layout challenge: automatically aligning a performance graph and a detailed data table side by side with clean 50/50 balance for our Sapporo Office deck.

It is an essential design automation skill for building professional presentation decks, so stay tuned!