When using window.alert('...') in an InDesign UXP plugin, it sporadically works, at other times, crashes InDesign.
The “crashing” behavior resulted in varying results:
InDesign crashed (showing a popup asking if I want to submit a crash report, which I did)
InDesign crashed without even the “send crash report” popup showing up
InDesign froze entirely and couldn’t be closed without killing the process manually
InDesign didn’t freeze, but the plugin stopped doing anything (the UI wasn’t frozen, though), as if stuck in a loop. InDesign wouldn’t close without manually killing the process
Tested on
Edition
Windows 11 Pro
Version
22H2
Installed on
9/23/2022
OS build
22621.1992
Experience
Windows Feature Experience Pack 1000.22644.1000.0
Processor
AMD Ryzen 7 5800X 8-Core Processor 3.80 GHz
Installed RAM
32.0 GB
System type
64-bit operating system, x64-based processor
Pen and touch
No pen or touch input is available for this display
Fair enough (thank you for looking into this!), but in that case, I would suggest that it shouldn’t crash InDesign but immediately abort with an error message in the console instead. I remember that it was mentioned during office hours at some point that this is an essential piece of functionality, especially for existing InDesign devs (who might try to use it and, with the intermittent behavior, maybe not notice that it doesn’t work consistently)…
Unfortunately it doesn’t work in InDesign
I opted to use the (UXP) Dialog, even if they are not fully compatible.
I recommend using the helper library “Adobe XD Plugin Helpers”.
In my case I was using InDesign 19.4 which has a bug that always places the Dialog in the lower left corner ignoring also the dimension provided.
I randomly found a solution: force the dialog dimension via css for some reason make InDesign display the Dialog in the center of the screen.