var myPreflight = app.preflightProcesses;
var myReport = myPreflight.processResults;
myReport = myReport.replace(/\s+$/,"");
if (myReport == "None")
My problem is that this script doesn't distinguish between the Preflight for the current document and that for any other document that may be open. I assume it is using the FIRST Preflight process created which will not always be for the current document.
Is there a way to reference the Preflight for the current document only? Searching for "Preflight" in the Object Model Viewer in ExtendScript Toolkit bring up No Results.
maybe you should check this "array":
Property AggregatedResults As Variant
Member of InDesign.PreflightProcess
The aggregated results found by the process. Type: Ordered array containing DocumentName:String, ProfileName:String, Results:Array of Ordered array containing ParentNodeID:Long Integer, ErrorName:String, PageNumber:String, ErrorInfo:String, ErrorDetail:Array of Ordered array containing Label:String, Description:String
or maybe you should set PreflightScope - to your Document - in PreflightOptions:
Property PreflightScope As Variant
Member of InDesign.PreflightOption
The pages or documents to preflight, specified either as an enumeration or a string. To specify a range, separate page numbers in the string with a hyphen (-). To specify separate pages, separate page numbers in the string with a comma (,). Type: idPreflightScopeOptions enumerator or String
I have now found the Preflight classes in the EST Object Model Viewer, I was searching under Adobe InDesign CS4 (3.0) not (6.0) !
I hope I can now make sense of the info...
Here's a sample function that returns true if the active document passes live preflight, and returns false if it has failed live preflight for some reason.
Function CheckPreflight() 'As Boolean
'oID is created elsewhere, it is the InDesign.Application object
Dim p 'As InDesign.PreflightProcess
For Each p In oID.PreflightProcesses
If p.AggregatedResults(0) = oID.ActiveDocument.Name Then
CheckPreflight = (Left(p.ProcessResults, 4) = "None")