I have a paragraph object being returned by a search. What I want to know is where in the text frame it appears. I actually only need to know if it appears at the beginning of the page. The pages will always be in a uniform position, but could be either left or right hand pages.
From what I can see, I could use baseline, as this will tell me the Y axis, but it would change if I changed font/leading size in the future. As it is a 2 column layout, I could also get a false positive on baseline if my paragraph appears at the beginning of the second column.
Does anyone have any suggestion on how to prove if a paragraph is at the beginning of a page?
I don't know if it is the best way, but I have solved my own problem now. I used the parent text frame, found the first paragraph, then compared the contents.
if(paragraphToCompare == myTextFrame.paragraphs.firstItem())