Suppressing dialog boxes
It is important to be able to control dialog boxes properly from a script. If a dialog appears while a script is executed, it stops until a user dismisses the dialog box. This is normally fine in an interactive script that expects a user to be sitting at the machine. But if a script runs in an unsupervised (batch) mode, you do not want dialogs to be displayed, stopping your script.
You use the displayDialogs property of the Application object to control whether or not dialog boxes are displayed.
To set dialog preferences, you use the displayDialogs property of the Application object.
displayDialogs = DialogModes.NO
In the scripting reference, Part 2 of this book, look up the Application object property displayDialogs, and then look up the constant DialogModes in the “Constants” chapter.