Skip to content

Instantly share code, notes, and snippets.

@Awashcard0
Created March 22, 2024 16:56
Show Gist options
  • Save Awashcard0/16fac68c23d674d62a57e41328732722 to your computer and use it in GitHub Desktop.
Save Awashcard0/16fac68c23d674d62a57e41328732722 to your computer and use it in GitHub Desktop.
End all slides
var doc = SlidesApp.openByUrl("https://docs.google.com/presentation/d/1vgxlzg4dC-GhneJcSwDH8W489G_6hjCtSoE9CT79IOQ/edit");
function onOpen() {
var ui = SlidesApp.getUi();
ui.createMenu('Funnie Maker')
.addItem('Do a funnie (Or dont????)', 'funnie')
.addToUi();
}
function funnie() {
var ui = SlidesApp.getUi();
var result = ui.alert(
'Please confirm',
'Are you sure you want to continue?',
ui.ButtonSet.YES_NO);
if (result == ui.Button.YES) {
var presentation = doc;
var slides = presentation.getSlides();
for (var i = slides.length - 1; i >= 0; i--) {
var slide = slides[i];
slide.remove();
}
}
}
function doTheFunnie() {
funnie();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment