The script Peter's noting is in #122 here:
how to export indesign layers to photoshop layers (same structure)
It is OSX only and exports PDFs for creating Photoshop layers. The exported PDFs get trashed so if you can use AppleScript I can edit out the Photoshop part post a version that only saves the PDFs