How is the function constructed?
How is the function executed?
Code using function is the given below.
var preflightName = "test";
var myDoc = app.activeDocument;
var preflightProfile = app.preflightProfiles.item(preflightName);
var preflightProcess = app.preflightProcesses.add(myDoc, preflightProfile);
var waitProcess = preflightProcess.waitForProcess();
var result = preflightProcess.processResults;
if (result != 'None')
var errors = preflightProcess.aggregatedResults;
alert("Preflight : " + preflightProcess.aggregatedResults.length + " error(s) ");
if(errors.length > 0) // Errors count
alert("check " +myDoc.fullName.fsName.replace(".indd",".txt"))
preflightProcess.remove(); // Cleanup
I can't see a major flaw here unless maybe some possible issues but not specially related to teh original issue.
So given that the code construction wouldn't be the main issue, did you check what the "result" value is ? If different of 'None', your function does…nothing thus possibly giving the feeling the function isn't working.
Another possible issue (tweasted I admit) would be that a secondary test function is defined or has been defined in a session script. So that second function flattened yours.
At your point, I would be an elementary step by step debugging by placing alerts everywhere to see where your function stops.
Thank you.. when I debugging step by step i found the issue in the script "ExportPreflightReport.jsx". I got the solution from this forum from the below url. The same issue happened to me.
- Sudha K