I have some .aep files which may generate one or more warnings upon opening, but I also want to be able to react to these warnings from the script.
E.g. when I open this one project, I get 2 warnings:
- "this project must be converted from version 11.0.4 (Macintosh 64). The original file will be unchanged"
- "The following layer dependencies are missing: (font references)"
The script goes something like:
var projectPath = "D:\\path\\to\\project.aep";
app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES);
try
{
app.beginSuppressDialogs(); // otherwise it will wait for UI interaction
app.open(new File(projectPath));
}
catch (err)
{
// this will hit if the file does not exist etc
console.log("oops, something happened: " + err.message);
}
finally
{
app.endSuppressDialogs(false); // if true it will show an alert (2), about the missing deps
}
Is there any way of retrieving these warnings? It would make more sense if app.endSuppressDialogs(false) actually returned the warnings, but it just returns null.