I created an applescript to tell another program to take a certain image link and place that particular image into a new rectangle that was also created through the applescript onto an opened indesign document. It works great! Now I want to take that same applescript and instead of creating a new rectangle object, i want it to be placed on a selected rectangle instead.
Here is my script:
FileMaker Pro Script Step:
set upclink to cell "itemupc" of current record
InDesign AppleScript:
tell application "Adobe InDesign CS6"
activate
set itemlink to "Volumes:ImageByUPC:" & upclink & ".eps" --Creates ImageByUPC image link to place
set myDocument to active document --User's active document becomes document to place image
tell myDocument
set noColor to swatch "None" --same as transparent
set myRectangle to make rectangle with properties {fill color:noColor, stroke color:noColor, geometric bounds:{0, 0, 3, 3}} --creates new rec at top of doc
place alias (itemlink) on myRectangle --InDesign's place function
fit myRectangle given proportionally --scales image
fit myRectangle given center content --scales image
end tell
end tell
I know I need to set myRectangle to the current rectangle (somehow) instead of a new rectangle being made. But can't get it to properly work.
Thanks!