0
votes

I have a presentation which include 3/4 inserted images on each slide.
the images are all in different positions via scripts.

I’m currently trying to link the images to a slide or two after the current one its on. similar to the link ???? option when right clicking the images.

e.g: image 1 on slide [0] links to slide [1]
image 2 on slide [0] links to slide [2]
image 3 on slide [0] links to slide [2]

This will then continue for the next slide as follows:

e.g: image 4 on slide [1] links to slide [[3]]
image 5 on slide [1] links to slide [4]
image 6 on slide [1] links to slide [3]

the outcome will need to allow the image number/id (pageElement) and the slides index to be continuously editable.

Is this possible and if so, any input would be appreciated. I’m a newbie at scripting and have tried a few alternatives with no personal outcome. Here is a sample with the positions script and a few sites/options explored/looked at. Thank you

  • Selection.getPageElementRange
1

1 Answers

1
votes

This can be done by getting the images from the slide and setting a link slide for each particular image:

For example, to set image 1 on slide [0] links to slide [1]:

SlidesApp.getActivePresentation().getSlides()[0].getImages()[0].setLinkSlide(1);

References:

Class Presentation

getImages()

setLinkSlide(slideIndex)