How does the script determine whether an image is outside the text box or positioned inside it?
Does “parentTextFrames” refer to the immediate parent or the outermost level?
Is it possible to check whether a text frame exists at the outermost level, regardless of the currently selected layer?
I’m currently using the method below to check, but it feels a bit clunky—sometimes I need multiple parents.
Is there a simpler way to do this?
Also, how can I distinguish between images and rectangular frames?
Often, they’re both called “Rectangle.”
Should I check for the presence of an “image” property?
Thanks.
Some thing like this:
var doc = app.activeDocument;
var item = doc.selection[0];
var items = doc.selection;
//outside
if (
(gra && 'Spread' == item.parent.constructor.name)
&& ('Rectangle' == item.constructor.name)
) {
sel = items;
do….
}
exit();
}
