I'm having a hard time with an option in the pdfExportPresets. I can change almost everything, but not ExportLayersOptions. I'm trying this:
p = app.pdfExportPresets.item ('[Press Quality]').duplicate();
p.exportWhichLayers = ExportLayerOptions.exportVisibleLayers;
For good measure I tried the numeric enumeration as well: p.exportWhichLayers = 1702393452, but that didn't improve things. All the other options that I tried worked fine, it's just this one that's stuck at Visible & Printable.