Skip to main content
Participant
January 20, 2014
Question

Problem with save preflight report using javascript in macintosh

  • January 20, 2014
  • 1 reply
  • 3198 views

Hi Experts,

I need to generate preflight report from InDesign CS5. But I got a error in "ExportPreflightReport.jsx"

Here is my code:

    var myDocument = app.activeDocument;

    var myProfile = app.preflightProfiles.item("IMAGE_CHECK");

    var myProcess = app.preflightProcesses.add(myDocument, myProfile);

    myProcess.waitForProcess();

    var myResults = myProcess.processResults; 

    if (myResults != "None"){

          myProcess.saveReport(File(File($.fileName).path+"/myreport.pdf"));

   }

Please provide suggestion anything wrong in my code.

Thanks

Velladurai.G

This topic has been closed for replies.

1 reply

Legend
January 20, 2014

Have you created the profile name called "IMAGE_CHECK" in InDesign.

Can you post the error for reference.

Vandy

ID ScriptAuthor
Participant
January 20, 2014

Yes. I have already created the profile name as "IMAGE_CHECK".

Error is "Object doesn't support this property or method '1'" in "ExportPreflightReport.jsx" File.

Please look below the screen short for your reference:

Participant
May 7, 2014

I have the same issue. My guess is that there is a bug in ID that makes PreflightProcess.saveReport() fail.

I think that this is what is happening:

When saving a preflight report in ID, a script file "ExportPreflightReport.jsx" is read by c++ code in ID. This script file is modified in memory to provide values for the arguments array in the script. The modified script is then executed. This works fine if the preflight report is saved from the UI in the preflight panel. It does not work when PreflightProcess.saveReport() is called from javascript. In the latter case, the arguments array is empty and thus the ExportPreflightReport.jsx script fails.

Is it possible to get a comment from Adobe?

I'm running ID CS6 on mac BTW.

In Regards,

Magnus