PreflightScope not working
PreflightOptions.preflightScope in InDesign has not worked since at least CS 5.5. No matter what value is used, preflight checks the whole document. Here is a sample script (error for color image <250 ppi) that the issue can be tested:
var currDoc = app.documents[0];
if (app.preflightProfiles.itemByName("export").isValid){
app.preflightProfiles.itemByName("export").remove();
}
var pfProfile = app.preflightProfiles.add({name: "export"});
var pfResRule = pfProfile.preflightProfileRules.add("ADBE_ImageResolution", {flag: PreflightRuleFlag.returnAsError});
pfResRule.ruleDataObjects.add("color_min_res", RuleDataType.realDataType, 250);
currDoc.preflightOptions.preflightScope = '1-2';
var pfProcess = app.preflightProcesses.add(currDoc, pfProfile);
pfProcess.waitForProcess();
pfResults = pfProcess.aggregatedResults[2];
$.writeln(pfResults);
––> with a 3-page document with problems on pages 2 and 3, InDesign reports both problems despite the scope been set to ‘1-2’ (same with ‘1’ and ‘1,2’)
We would very much like to speed our preflight process and get rid of the tedious parsing of preflight results only to discard pages not set in the scope.
One additional note on its behavior that could be fixed, too: if you define a scope that includes page numbers not in the document, either as
- a range e.g. "1-5" when document has pages numbers 1,4,5,6,... or
- e.g. "14" when the document has only 12 pages
––> InDesign throws an error "Error 30477: Invalid value for set property 'preflightScope'. Expected PreflightScopeOptions enumerator or String, but received "1-5".", which is quite misleading.
Thanks for reporting
We are reviewing the issue
-InDesign Team
-
Jens Trost commented
Can confirm in CC 2020.
preflightWhichLayers is also not working.
-
Patrik commented
A correction to the report: I just learned that currDoc.preflightOptions.preflightScope = "1-2"; changes the UI preflight panel's scope and not the script-run preflight's scope. When running preflight from script, the scope should be defined in the preflightProcesses.add() method:
var pfProcess = app.preflightProcesses.add(currDoc, pfProfile,{preflightScope:"1-2"});
However, this ticket is still valid, because that argument does not work and InDesign always preflights the whole document.