Using AppleScript, I want to alter the x and y position of a particular image on every slide of a Keynote document. Once Keynote is running and activated, the following code works...
tell the front document
set the current slide to slide 1
tell the current slide
set thisImage to image 1
set position of thisImage to {10,10}
end tell -- current slide
end tell -- front document
... but it's too fragile. If my image is not the first one ("image 1") then I'll be changing the position of the wrong object. I can't find anything in the scripting dictionaries or in on-line examples about expressing an object specifier for a particular image. I tried several variations on things like...
set thisImage to image with file name "my-file.png"
... to no avail. Any and all advice is appreciated. Thanks!
This works in Keynote 8.2, but to be honest, I'm not sure why.
However, if you want to then ask thisImage what its name is, you have to ask for its file name, e.g.…
Every time I use any presentation software, I somehow like them all less.
You have some redundancy (around 'current slide') so here is my take:
Finally, since your objective is to cycle through every slide in the deck, you could try this: