Mysterious EvalScript errors from ModalDialog
Hi,
I'm working on an inDesign extension (with type `ModalDialog`) and run into this mysterious problem. When the extension is used for the first time after inDesign is launched, my ExtendScript functions fails (it doesn't happen every single time, but pretty often). And when it fails, it stays in the broken mode until the extension is re-opened. The failed ExtendScript function can be anything that tries to make a change (for example: `app.jpegExportPreferences.pageString = '1'`).
If I change `ModalDialog` to `Panel` in the manifest.xml, the problem goes away. But from the product perspective, I can not use `Panel` because I have to make sure user can not make changes to the inDesign file while this extension is opened.
I have uploaded a zip file to debug it. Here is how to reproduce:
1. Unzip the file and put it into your local extension folder (Mac: `~/Library/Application\ Support/Adobe/CEP/extensions/`, Win: `C:\Users\<USERNAME>\AppData\Roaming\Adobe\CEP/extensions`)
2. Launch inDesign;
3. Open any inDesign file;
4. Open the extension via `Window -> Extensions -> Modal dialog demo`;
5. Click the two buttons in the extension (The first button reads `app.jpegExportPreferences.pageString`, which always success. The second one tries to update this value, which fails on the first launch);
6. If the second button returns `EvalScript error`, close and reopen the extension (without closing inDesign) makes the problem goes away;
