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
Copy link to clipboard
Copied
Have you created the profile name called "IMAGE_CHECK" in InDesign.
Can you post the error for reference.
Vandy
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:
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
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
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
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
for(n = 0; n < this.arguments.length; n++) params[this.arguments
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
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.
Copy link to clipboard
Copied
Thank you @sebastianw88921027 - your edits to the ExportPreflightReport.jsx script are still required when running InDesign Server 2023 (v18.2.1). Thanks.