What would be a good way to turn a selection of images to individual slides? This would allow one to drop a folder/multiple images into one slide, select them, and with one fell swoop, distribute them to individual slides, which saves a lot of time compared to the alternative of making a new slide and dropping an image, one-by-one.
I'm thinking something like the following, need help fixing it so that it is not pseudo code
const selection = SlidesApp.getActivePresentation().getSelection(); var currentSlide; selection.forEach( currentSlide = SlidesApp.getActivePresentation().getSelection().getCurrentPage().getObjectId(); presentation.insertSlide(currentSlide, BLANK) slide.insertImage(image) );
delete the original selection, not sure what good practice code for that would be
alternative would be to iterate through the selection and move them one by one, but that seems an unnecessary replication of how a human would do it.
I've made another script that centers existing images on slides, but stuck about here
function sortImage() {
const slide = SlidesApp.getActivePresentation();
//store selected slide
let selectedSlide = SlidesApp.getActivePresentation().getSelection().getCurrentPage().asSlide();
//gets all the images in the first slide
let images = selectedSlide.getImages();
// trying to get insertion index of selected slide
let selectedSlideIndex = SlidesApp.getActivePresentation().getSelection().getCurrentPage().getObjectId();
// iterates all images in the array
images.forEach((image) => {
//adds a new slide
slide.insertSlide(selectedSlideIndex += 1)
let current_slide = slide.getSlides()[selectedSlideIndex];
//insert the image in the newly created slide
current_slide.insertImage(image);
//delete the image in the first slide.
image.remove()
});
}

