I had a script working that created a new document using a preset in InDesign CS3. Since I upgraded to CS5, app.documentPresets only contains [Default]. I've even output the length and count() of the app.documentPresets array. Both result in 1.
Here's some of the code:
$.writeln ( 'app.documentPresets.length=' + app.documentPresets.length)
$.writeln ( 'app.documentPresets.count()=' + app.documentPresets.count())
for( var q = 0; q < app.documentPresets.length; q++ )
The presets clearly exist in the UI.
I even tried running the script with the 5.0 DOM by including app.scriptPreferences.version = 5; What am I doing wrong?
I got it to work by exporting the doc preset to a file and then importing it in the script once.
app.importFile( ExportPresetFormat.DOCUMENT_PRESETS_FORMAT, File( BASE_PATH + "nl11x17docpreset.dcst" ) );
I don't know why this was necessary.