InDesign CS: get page number

Hi!

InDesign CS: How can I get the page number of any page item in a document? There seems to be no property, so I tried something like this:


	set p to myItem
	repeat until class of p = page
		set p to parent of p
	end repeat
	return index of p

Is there a better method to get the page number?

And how can I get the page number of an item embedded in a text frame, when the story continues over more than one page? My parent method only returns the page where the story begins.

Thanks for reading.
jo