I want to make an interactive slideshow for students.
I want to add shapes, so when you click on the shape it will run an Apps Script script. This is possible in Google S
There is no way to run a container-bound script by clicking a shape in Google Slides like you can in Google Sheets. But, you can accomplish a similar effect by adding a shape with a link to a web app that runs your script when opened. For Example, here is a script for a web app that changes the text on the first shape of the first slide whenever someone visits it.
function doGet() {
const presentation = SlidesApp.openById(id); // presentation id
const slide = presentation.getSlideById(id); // slide id
const textBox = slide.getShapes().filter(_s => _s.getObjectId() === objectId)[0].getText(); // id of your text box object
const clicks = Number(textBox.asString());
textBox.setText(clicks + 1);
return ContentService.createTextOutput("Thanks for clicking!"); //message to display when user visits your webapp
}
Here is a working example: Google Slide Presentation with Clickable Button