Splitting a multi-page InDesign document into individual pages...

I am trying to write a script that will take a multipage indesign document and save all pages as individual documents. I haven’t had any success with this. It seems like there is no way to tell the application to interact with individual pages in a layout. Does anybody have any experience with this kind of process?

Jonathan