• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem with save preflight report using javascript in macintosh

Community Beginner ,
Jan 19, 2014 Jan 19, 2014

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 19, 2014 Jan 19, 2014

Copy link to clipboard

Copied

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

Can you post the error for reference.

Vandy

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 20, 2014 Jan 20, 2014

Copy link to clipboard

Copied

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:

Picture 3.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 07, 2014 May 07, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 07, 2014 May 07, 2014

Copy link to clipboard

Copied

@Magnus – the code the OP is providing at the start of this thread is working for me.

Tested with:

InDesign CS5.5 on Mac OSX 10.6.8.

InDesign CS6 on Mac OSX 10.6.8.

Could there be something like a "timeout" problem with bigger InDesign files?

Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2014 May 09, 2014

Copy link to clipboard

Copied

@Uwe

I tried running the script again and this time it worked. Previously, I got the same error as the OP. I do not know what has changed or why it works now but not before. I'll investigate further and post if I figure out anything more.

Thanks for you help!

Magnus

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2015 Apr 17, 2015

Copy link to clipboard

Copied

Hi,

the fix for me was (testet on InDesign CS6 8.0.2) to replace the followin line in the ExportPreflightReport.jsx script.

//for(n = 0; n < arguments.length; n++) params[arguments[0]] = arguments[1];

for(n = 0; n < this.arguments.length; n++) params[this.arguments[0]] = this.arguments[1];

And if you want to use the script on a IndesignServer you need to replace also to following line:

it is near line 290 in the "CreateWorkingDoc" function

//var doc = app.open(templateFile, false); // No window (don't want user seeing the doc building)

    var doc = app.open(templateFile); // in IDS you need only one Paramater

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 23, 2023 Feb 23, 2023

Copy link to clipboard

Copied

Thank you @sebastianw88921027 - your edits to the ExportPreflightReport.jsx script are still required when running InDesign Server 2020 (v15.0.2). Saved me lots of time! Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2023 Jul 05, 2023

Copy link to clipboard

Copied

LATEST

Thank you @sebastianw88921027 - your edits to the ExportPreflightReport.jsx script are still required when running InDesign Server 2023 (v18.2.1). Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines