Apps script documentation appears to suggest it is possible to copy a table from one slide to another - but I can't seem to get it to work. This is the script I've used - any thoughbts on what I'm doing wrong? Here's a link to an example of it in "use".
* @OnlyCurrentDoc
*/
/*
Instructions copied from https://developers.google.com/apps-script/reference/slides/slide#insertShape(ShapeType)
// Copy a table between presentations.
var otherPresentationSlide = SlidesApp.openById('presentationId').getSlides()[0];
var currentPresentationSlide = SlidesApp.getActivePresentation().getSlides()[0];
var table = otherPresentationSlide.getTables[0];
currentPresentationSlide.insertTable(table); // Also available for Layout, Master, and Page.*/
function test(){
var slide2 = SlidesApp.getActivePresentation().getSlides()[1];
var table = SlidesApp.getActivePresentation.getPageElementById('g2c6eee07fad_0_0').asTable();
slide2.insertTable(table);
In your showing script, how about the following modification?
From:
To:
SlidesApp.getActivePresentationis modified toSlidesApp.getActivePresentation().But, in this case, I think that
SlidesApp.getActivePresentation()can be declared as a variable as follows.Or, if you want to copy a table in the 1st page to 2nd page, the following modification might be able to be used.