Reputation: 10798
I need to use Google Apps Script, not the API.
-> I'd like to delete this empty slide, so that the presentation contains only the slide I paste into it.
The code I have:
var presentation = SlidesApp.create("my new presentation"); // creates an empty slide in the prez
presentation.insertSlide(0,slides.pop()); // a slide from a deck of slides collected elsewhere
presentation.getSlides().pop(); // here trying to delete the empty slide, doesn't work: the slide remains in the presentation.
presentation.saveAndClose();
Upvotes: 2
Views: 3400
Reputation: 139
To remove the first slide, use the shift()
method. The shift()
method pulls the first element off of the given array and returns it.
// Remove first blank slide
const removeFirstSlide = newPresentationSlide.getSlides().shift()
removeFirstSlide.remove()
But remember, to remove the first blank slide, you need more slides in your Presentation.
Upvotes: 0