A script which listens to the event beforeClose and which in some cases should show a dialog to choose between some options works very well after the normal close-command.
But it runs into a problem while quitting the application.
If the dialog doesnt have to be opened everything is ok.
But if the dialog appears, the application wants to quit while the script wants to open the dialog.
Both keep fighting with each other and so I have to shoot down InDesign.
How could the quitting of the application be blocked as long as the script is doing its job?
Or how could the eventscript be prevent from execution if the close-command is not executed by the user but by the quit-command?