Accessing errors in Indesign
Copy link to clipboard
Copied
How do I access the "errors panel" in Indesign (the one that shows missing fonts, overset text etc) using javascript?
Copy link to clipboard
Copied
Do you mean Live Preflight?
Copy link to clipboard
Copied
Hi,
Can you please try this below line:
app.scriptPreferences.userInteractionLevel=UserInteractionLevels.interactWithAll;
thx
csm_phil
Copy link to clipboard
Copied
Hi,
I don't know if it is what you meant but you can inspire from this following example to manipulate preflight from JS :
try{
// Basic
var preflightProfile = app.preflightProfiles.firstItem();
// Execution
$.writeln("Execution <" + preflightProfile.name + ">");
var preflightProcess = app.preflightProcesses.add(app.activeDocument, preflightProfile);
var preflightReturn = preflightProcess.waitForProcess();
preflightResults = preflightProcess.processResults;
$.writeln("Return value <" + preflightReturn + ">");
$.writeln("Return value <" + preflightResults + ">");
// Results
if (preflightResults != 'None'){
$.writeln("Preflight : " + preflightProcess.aggregatedResults[2].length + " error(s) ");
for (var i = 0 ; i < preflightProcess.aggregatedResults[2].length ; i++){
var preflightError = preflightProcess.aggregatedResults[2] ;
$.writeln("\n" + i + ".ERR - " + preflightError[1] +
"\n" + i + ".PAGE - " + preflightError[2] +
"\n" + i + ".INFO - " + preflightError[3]
);
}
}
preflightProcess.saveReport(File(yourDir + "/" + "preflight.pdf"), true);
// Cleanup
preflightProcess.remove();
} catch (ex) {
// Exception
}
--
Manu
Copy link to clipboard
Copied
Thanks, Is it possible to get the actual text frame that was overset USING preflight?
Copy link to clipboard
Copied
Hi,
I do not know. The preflight gives the page with an error. Perhaps, just browse the textframes of the page to detect that which is in overflow.
--
Manu

