Please try the below JS code is alert this Document is Portrait or Landscape only.
@cms_phil – this is only good for the ordinary InDesign CS4 or CS3 file. In CS5 and above you could mix "landscape" and "portrait" oriented pages in one single InDesign document.
For CS5 and above you have to loop through all pages and check width and height to calculate the orientation. I'm not sure that is enough, because you can do a lot of different transformations to a specific page that will affect the orientation of output (e.g. exported PDF files).
See what scripting can also do with CS4 files (and their spreads) regarding transformation:
Thanks. but which is for document pageOrentation. I need single page.
For example, If document is portrait but in this document only one page has landscape, that only I have to check.