I'm not sure of the JS syntax, as I mostly AppleScript InDesign, but get the objects as you did, and also query them for their parent page (parentPage?). If it is nothing (null?), then it's on the pasteboard.
Rick Gordon
------------------
On 2/18/13 at 6:33 PM +0100, Michel Raj wrote in a message entitled
"[ID] javascript erase all from pasteboard":
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
WWW:
http://www.shelterpub.com