The following is what I did:
Created a new presentation on Google Slides,
Edited one of the predefined layouts on the Master Layout view in order to have a new layout that I want to use,
Edited the name of the Master Layout to "Meeting",
Edited the name of the predefined layout that I want to use to "Office".
My problem is that on Google Script I am not being able to reference this specific predefined layout that I want to use.
So far, my code is the following:
function AddSlideToPresentatio() {
// The following line opens my presentation
var presentation = SlidesApp.openById('PresentationID');
//Now, I try to use my new layout
presentation.appendSlide("Office");
}
I have absolutely no idea on why this doesn't work. When I try to run it, I get the error:
"Cannot find method appendSlide(string). (line 6, file "Office").
The following are some of the combinations that I tried, and they get me similar errors:
presentation.appendSlide('Office');
presentation.appendSlide(Office);
presentation.appendSlide("Meeting - Office");
presentation.appendSlide('Meeting - Office');
presentation.appendSlide(Meeting - Office);
If I just use presentation.appendSlide()
it creates a new slide, but not with the layout that I want to use.
In the Google Apps Script Reference there are three methods:
- appendSlide(),
- appendSlide(layout),
- appendSlide(predefinedLayout)
However, I can't seem to understand what is the difference between that last two, because when I try to use them they seem to do the same thing.