Place img inside rectangle identified by scriptLabel
I'm only going to include a short piece of the overall script, since the question is fairly simple (and basic).
I'm hoping to identify a rectangle by scriptLabel on each page of a document and place an image inside it. "Target" is the scriptLabel applied to the rectangle in which the imgFile will be contained.
Thank you for any advice you might be able to provide.
var imgFile = "~/Documents/images/img-1.jpg";
var thisRectangle = myPage.rectangles[0];
var targetRectangle = myPage.rectangles[i].label == "target";
// works (targeted rectangle is first item on page)
try{
thisRectangle.place(File(imgFile));
}
// doesn't work (targetRectangle is not a function)
try{
targetRectangle.place(File(imgFile));
}
