I just want a function to run whenever a new page is created in inDesign. Adobe's documentation appears to let you attach event handlers to nearly all objects, but they don't give any examples of how to do this past the document level.
var myEventListener = app.eventListeners.add("afterNew", myAfterNewHandler);
How do I get this to trigger on creation of a new page. I've already tried replacing app
with app.document.pages
and it did not work.