Copy link to clipboard
Copied
Hello,
we use InDesign server for automated document processing. When a file is opened (via an ExtendScript script) that uses one or more plugins that are not installed, InDesign server outputs the following log message:
Thu Aug 22 12:10:36 2024 ERROR [server] The document "document.indd" uses one or more plug-ins which are not currently available on your system. We strongly advise you not to open the document.
Though this is logged as an error, InDesign server does not stop script execution and continues with the rest of the script. This goes unnoticed unless the log is explicitly checked or some data corruption is visible in the file.
Is there a way to tell InDesign server to stop execution when this error occurs (like with other errors during script execution)? Or is there a way to explicitly check if there are any missing plugins with a script command?
I tried to count the amount of error output (stderr) the process emits during execution to check if there was any error that did not stop execution. But unfortunately, this error gets emitted via standard output (stdout) and not standard error output (stderr).
Any other ideas? I really do not want to use some string/regex check on the log entries.
Greetings,
Dean
After communicating with Adobe-Support, they helped find a workaround to reliably detect any errors occured after opening.
They provided the following example:
//Turn on Error List
app.serverSettings.useErrorList = true;
//Open test doc
var myDoc = app.open(File("/C/PATH/TO/FILE/example.indd"));
//Check error list
for (i=0; i < app.errorListErrors.count();i++)
{
//write out the error time and error string
$.writeln(app.errorListErrors.item(i).listErrorTime + " " + app.errorListErrors.item(i).li
...
Copy link to clipboard
Copied
After communicating with Adobe-Support, they helped find a workaround to reliably detect any errors occured after opening.
They provided the following example:
//Turn on Error List
app.serverSettings.useErrorList = true;
//Open test doc
var myDoc = app.open(File("/C/PATH/TO/FILE/example.indd"));
//Check error list
for (i=0; i < app.errorListErrors.count();i++)
{
//write out the error time and error string
$.writeln(app.errorListErrors.item(i).listErrorTime + " " + app.errorListErrors.item(i).listErrorMessage);
}
//Clear the error list
app.clearAllErrors();
//Close test doc
myDoc.close();
Which i modified to this:
//Turn on Error List
app.serverSettings.useErrorList = true;
//Open doc
var myDoc = app.open(File("/C/PATH/TO/FILE/example.indd"));
//Abort if at least one error occured (log level "ERROR")
for (i=0; i < app.errorListErrors.count();i++)
{
if (app.errorListErrors.item(i).listErrorLevel === 3) {
throw new Error("Document opened with at least one error.");
}
}
// Turn off error list
app.serverSettings.useErrorList = false;
// Go on with script...
I iterate over all errors and check if at least one is logged with the log level 3 (ERROR). I do this because this list also contains warnings (log level 2, e. g. missing fonts/images) but i do not want to abort in these cases.
Best regards,
Dean