0

I have a script that copy-pastes slides from a Presentation A into a Presentation B.

In order to do so, I use PresentationA.getSlides() and PresentationB.appendSlide().

The script works really well but it is unfortunately realy too slow for my use case.

I have made my calculations and I found that I was limited to 200Ko/s when I write into Presentation B (line 9 in the code below).

So for instance if I have 20 Mo to copy paste from Presentation A to Presentation B, it takes about 2 minutes.

Is there a way to increase this limit (200 Ko/s) ? We would need something like 2 Mo/s for our use case.

Here is the code that I use to do so. Any help would be amazing :)

var body = JSON.parse(e.postData.contents);
var ids = body.ids;
var new_presentation = SlidesApp.openById(body.newId);
var slides = []
for(var i in ids) {
  slides = slides.concat(SlidesApp.openById(ids[i]).getSlides());
}
for(var s in slides) {
  new_presentation.appendSlide(slides[s])
}

Thanks for your help.

Jérémy

  • Do you want to make exact copies of the Slides? It would be much faster copying the entire file with Drive. – Jescanellas Oct 30 '19 at 08:30
  • Hi Jescanellas. I want to merge serval Presentations into one Presentation. So the copy route from drive api is not a solution. – Jérémy Roche Oct 30 '19 at 11:15
  • I checked the [slides API](https://developers.google.com/slides/reference/rest/v1/presentations/get) but I don't think it would work faster than Apps Script. – Jescanellas Oct 30 '19 at 12:53
  • Hi @JérémyRoche have you ever found a solution ? I have the same issue regarding appendSlide Speed, whenever there's a slide with big pictures it can take forever – Alb Dum Jul 21 '20 at 13:01

0 Answers0