Google Slides and Apps Script

Hi,

I would like to create a very specific page numbering on my slides.

I would like to use Apps Scipt for this
But I find few sources

I can't get the position of a slide in the presentation?
There is an AutoText Class but I can't find any example to use it

Can you help me?
Thanks

Solved Solved
0 9 2,994
1 ACCEPTED SOLUTION

Stephane_fr
Google Developer Expert
Google Developer Expert

This will work

function slidePageNumber() {
  let current =  SlidesApp.getActivePresentation().getSelection().getCurrentPage().getObjectId();

  const pages = SlidesApp.getActivePresentation().getSlides();
  for(let i = 0 ; i < pages.length ; i++){
    if(pages[i].getObjectId() == current){
      console.log(i+1)
      return ;
    }
  }
}

Stรฉphane

View solution in original post

9 REPLIES 9
Top Labels in this Space
Top Solution Authors