Locking certain parts of a Google Slides assignment to the background of the slides can prevent unnecessary frustration for both you and your students. However, the standard process for setting a specific image to the background can be tedious, especially if the assignment contains more than a few slides. A Google Slides template using Google Apps Script provides a fast and easy solution and has saved me a countless number of hours and hundreds of clicks on trackpad.
/**
* @OnlyCurrentDoc
*/
function onOpen() {
var ui = SlidesApp.getUi();
ui.createMenu('Images')
.addItem('Set as Backgrounds', 'setBackgrounds')
.addToUi();
}
function setBackgrounds(){
var slides = SlidesApp.getActivePresentation();
var images = slides.getSlides()[0].getImages();
if(images.length > 0){
images.forEach(function addBG(picture){
let slide = slides.appendSlide(SlidesApp.PredefinedLayout.BLANK);
slide.getBackground().setPictureFill(picture);
});
} else {
SlidesApp.getUi().alert("There are no images on this slide.");
}
}