Can I get any suggession for the above question.
Test the geometricBounds of the new frame after placing against all other frames on that same page?
From you image it looks like the widths are the same, so you only have to compare y positions.
I am doing the task of placing the images into the indesign pages based on its references text. For example, If there is a text "Figure 1", then figure 1 is placed on that page. I wrote the JS script for doing the art placement. This works fine.
The problem is, if there is more than one reference in a same page, for example, we have "Figure 1 and Figure 2", my script will place both images in the same page one before another.
In this situation, I want to place Figure 1 on same page and Figure 2 on next page. For this, I need to find whether any grouped frames is placed at background before placing figure 2.
Maybe think about placing graphic as ANCHORED ?