1

I have a Google Drive folder with multiple Google Slides files. How can I merge all these files into one "Master" Google Slides file via script / programmatically? The files are static and will not be updated anymore after the merge. The new Master Google Slides containing all presentations could be manually edited. Thanks.

  • Hi, did you ever find how to do this ? I've been searching for a while, no answer yet – Alb Dum Apr 23 '21 at 15:21
  • https://stackoverflow.com/questions/46802620/copying-a-slide-from-one-google-slides-presentation-into-another Nov 13 '17 at 4:45 Tanaike shared code to copy slides between presentations. Once you have done this delete the source presentation – aNewb Aug 21 '21 at 00:12

1 Answers1

0

This is the script I used to merge multiple google slides into one master presentation. The newly created file will be called "Merged Presentation" and will be stored in the user's root folder of Google Drive.

You need to pass the presentation URLs (that need to be merged) in the function in the form of an array.

function mergeSlides(presentationURLs) {  // -> array of presentation slides to be merged
var newdeck = SlidesApp.create("Merged Presentation");  //name of the new file
var newURL = newdeck.getUrl();
var newdeck = SlidesApp.openByUrl(newURL);   //created and opened a new deck

for (let j=0; j<presentationURLs.length; j++)  //for each url
{
  var tobeappended = SlidesApp.openByUrl(presentationURLs[j]);
  var slides = tobeappended.getSlides();
  for (let i=0; i<slides.length; i++)  //for each slide of the file
  {
    newdeck.appendSlide(slides[i]);
  }
}
var newslides = newdeck.getSlides();
newslides[0].remove();
}