Copy link to clipboard
Copied
Hi All,
Is it possible to find the Image Name for behind the selection text frame?
My output or alert should be "bcd.tif".
Regards
Siraj
Copy link to clipboard
Copied
It maybe a good start
Copy link to clipboard
Copied
Kartik -- The link you gave doesn't really answer the question. That link is about stacking order (and misses the simple solution that the frame with the lower index is on top). Siraj want to find the image that's behind the selected text frame, and that can be done by comparing the geometric bounds, as Jarek suggested in that same thread. (For stacking order, see [JS] :: [CSX] - PageItem Stacking Order.
Peter
Copy link to clipboard
Copied
Hello Peter,
Yes the link is not a direct answer for Siraj. But i thought he may get some ideas how to approach...
Copy link to clipboard
Copied
Hi,
get all TextFrames on the spread, get all Images on the spread and then check which textframe is above an image
by comparing the bounds:
if ( textGB[0] >= imgGB[0]
&& textGB[1] >= imgGB[1]
&& textGB[2] <= imgGB[2]
&& textGB[3] <= imgGB[3]) {
Does the textframe need to be completly on the image or is it valid also if it only overlaps ?
Thanks Stefan
Copy link to clipboard
Copied
See here for an answer Re: find text frame behind rectange