Skip to main content
Known Participant
June 15, 2011
Question

Accessing errors in Indesign

  • June 15, 2011
  • 3 replies
  • 1992 views

How do I access the "errors panel" in Indesign (the one that shows missing fonts, overset text etc) using javascript?

This topic has been closed for replies.

3 replies

Manu Brochard
Inspiring
June 16, 2011

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]
                              );
        }
   }

   // PDF
   preflightProcess.saveReport(File(yourDir + "/" + "preflight.pdf"), true);

   // Cleanup
   preflightProcess.remove();

} catch (ex) {
   // Exception
}

--

Manu

xmlapiAuthor
Known Participant
June 16, 2011

Thanks, Is it possible to get the actual text frame that was overset USING preflight?

Manu Brochard
Inspiring
June 17, 2011

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

csm_phil
Legend
June 16, 2011

Hi,

Can you please try this below line:

app.scriptPreferences.userInteractionLevel=UserInteractionLevels.interactWithAll;

thx

csm_phil

John Hawkinson
Inspiring
June 16, 2011

Do you mean Live Preflight?