In Google Slides it's possible to import slides deselecting "Keep original theme."
But this doesn't leave the imported slides with the desired layout from the current presentation's masters.
When attempting to re-apply the desired layout from the current presentation, this doesn't seem to have any effect on the imported slides. They seem to have kept some formatting.
So to fix that you have to manually select a slide, select its text elements/placeholders and choose "Clear formatting" from the Format menu.
That's a bit tiring and tedious. What I'd like to do is create a script that would cycle through the selected placeholders in the current slide and clear the formatting for each of them such that they (title, subtitle, body) adopt the style/layout of the relevant master from the current presentation.
Any suggestions?
Bonus points: cycle through selected slides and do the same.
function clearFormattingOfSlidesPlaceholders() {
var selection = SlidesApp.getActivePresentation().getSelection();
var type = selection.getSelectionType();
switch (type) {
case SlidesApp.SelectionType.PAGE:
var pageRange = selection.getPageRange();
if (pageRange) {
var pages = pageRange.getPages();
Logger.log('Clearing format for ' + pages.length + ' selected pages');
for (var i = 0; i < pages.length; i++) {
var page = pages[i];
var slide = page.asSlide()
// where to now?
}
} else {
Logger.log('Clearing format for 0 selected pages');
}
default:
break;
}
}