soulshake
soulshake

Reputation: 969

How to tell if a slide is "skipped" in Google Slides with Google Apps Script or API?

In Google Slides, it's possible to set a slide to be "skipped" in presentation mode (as described here).

However, the automated page numbering still includes skipped slides (meaning that in presentation mode, if slide 4 is skipped, the slide numbering jumps straight from 3 to 5).

I want to use Google Apps Script to generate my own slide numbers so only non-skipped slides are counted. But I don't know how to check if a slide is marked as "skipped."

Here's what I have in mind:

function genSlideNumbers() {
  var preso = SlidesApp.openById('PRESENTATION_ID');
  var slides = preso.getSlides()
  var slide_num = 1
  for (var i = 0; i < slides.length; i++) {
    slide = slides[i]
    if ( /* ?? slide is "skipped" ?? */ ) {
      slides[i].insertTextBox(slide_num);
      slide_num++;
    }
  }
}

Is it possible?

Edit: Not a duplicate of this question because I'm not asking how to skip a slide; I'm asking if there's any way to tell if a slide is skipped.

Upvotes: 4

Views: 862

Answers (2)

Aaron Dunigan AtLee
Aaron Dunigan AtLee

Reputation: 2072

Update: There is now a method slide.isSkipped() which determines if the slide is marked as skipped. (Also slide.setSkipped() to set whether the slide will be skipped.)

Upvotes: 3

user11417171
user11417171

Reputation: 11

As of 10/25/2019 there is no API access to the Skip Slide flag in the Slide or Presentation classes. Which means there's no method (using only Apps Script) to determine which slides to skip.

Ideally, there would be slide.getSkip() and slide.setSkip() methods, but they don't currently exist. You can request them here.

Upvotes: 1

Related Questions