Is there a way to compare the stacking order of two different page items?
For example, I want to know if (A) text frame that matches some specific geometric bounds is above or beneath (B) a rectangle that contains a PDF graphic.
I cannot seem to figure out how to derive at this.
Any help would be greatly appreciated.
Thanks,
-Jeff
In case anybody wants to know the answer to this:
( all page items ) was the key. Getting a list of all page items and then checking each item for some condition can get you the number of the item. Then you can do the same thing for another item in the same list that matches some other condition. You can then compare the numbers and determine, which item is above/below the other.
tell application id "com.adobe.InDesign"
tell active document
set allPageItems to all page items
repeat with i from 1 to count of items of allPageItems
set myBounds to geometric bounds of item i of allPageItems as string
if myBounds contains "234.614 pt347.717 pt357 pt609 pt" then
set myAddressFrameNumber to i
display dialog "The address frame was item " & myAddressFrameNumber & " of the stacking order"
end if
try
set myItem to class of item i of allPageItems as string
if myItem is "PDF" then
set myPDFNumber to i
display dialog "The PDF was item " & myPDFNumber & " of the stacking order" as string
end if
end try
end repeat
end tell
end tell