AppleScript needed for moving images depending on a table's cell content
Hi everyone,
I already posted a similar question and everything I've read about indicates that this should be possible through AppleScript, so I'm posting again with a new title in hope that some AppleScript wizard can help me (I've tried and failed to do it myself, I barely know any AppleScript).
What I'm trying to do is to move an already present image in the document (on another page) to a specified location in the first page, depending on wether a string is present in a cell.
It should be something like this:
For the front document of Pages,
If in "B2" of "Tabla 5-2" there is the string "Sunny", move "sun.png" to X=13,97cm Y=4,44cm of page 1
If in "B2" of "Tabla 5-2" there is the string "Windy", move "wind.png" to X=13,97cm Y=4,44cm of page 1
If in "B2" of "Tabla 5-2" there is the string "Cloudy", move "cloud.png" to X=13,97cm Y=4,44cm of page 1
If in "B2" of "Tabla 5-2" there is the string "Rainy", move "rain.png" to X=13,97cm Y=4,44cm of page 1
If in "B2" of "Tabla 5-2" there is the string "Stormy", move "storm.png" to X=13,97cm Y=4,44cm of page 1
Some notes:
- The Table's name and cell are accurate for my document (table name is in spanish, I don't know if this is important for AppleScript) (By the way, is there an easier way to find a table's name rather than trying writing a formula from scratch?)
- The image file names are accurate and are images already present in the document, in another page.
- The X,Y coordinates are accurate but I don't know if AppleScript takes values in cm (I guess not), and they are based on setting the origin of the ruler (0) at the center.
Hopefully someone can help me. I would be eternally grateful
Thanks!
iMac 27", macOS 10.13