Skip to main content
Participating Frequently
June 24, 2015
Question

Any way of capturing warnings/errors from endSuppressDialogs ? (app.open())

  • June 24, 2015
  • 1 reply
  • 481 views

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:

  1. "this project must be converted from version 11.0.4 (Macintosh 64). The original file will be unchanged"
  2. "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.

This topic has been closed for replies.

1 reply

Legend
June 24, 2015
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.

By entering true, you are effectively getting those warnings, but not as returned data though. There is no way that I'm aware of to obtain the exact data in dialogs being suppressed.

Participating Frequently
June 29, 2015

I know that the documentation for endSuppressdialogs(true) says that it shows any messages as an alert(), but the point of this is that it is a fully automated script (afterfx -r blah.jsx) and using 'true' would lock up the automation process waiting for user interaction.

Legend
June 29, 2015
but the point of this is that it is a fully automated script (afterfx -r blah.jsx) and using 'true' would lock up the automation process waiting for user interaction.

Understood, I was just mentioning that I think that is the only way to get messages from endSuppressDialogs unfortunately. It won't return the info any other way that I'm aware of.