that can split a PDF by top-level bookmarks (or chapters, as I call it). See
My script ignores bookmarks that don't lead to a certain page. Obviously if
the the bookmark's scripts causes a modal dialog like app.alert, the script
will be stuck until that dialog is closed. It's up to the user to know which
kinds of bookmarks their file has.