Validating Indesign File

Hi all,
I am working in mac in applescript for manipulating Indesign files like opening a file,importing xml into it, and applying styles etc.In this Indesign file manually i can validate that file, using structure pane window in that by clicking a button “Validate.” By clicking that it shows whether error exist in that file or not.
This validating checking process i suppose to do in applescript code. But i couldn’t get any idea about this,I don’t know how to script this “Validating InDesign File” process.So if anyone is there please help me out to sort out this problem.

-Jacinta Mary