Preventing Multiple Dialog Windows in ExtendScript (Photoshop)
Hello everyone,
I’ve written an ExtendScript panel for Photoshop that opens a custom dialog via File > Export > My Script. However, I’ve noticed that if a user clicks the menu item multiple times, it opens multiple instances of the same window.
I want to ensure only one instance of the dialog is open at a time—a common feature in many apps. For example, even in modded apps like [link removed] you typically can’t open the same chat window twice; it just brings the existing one to focus.
What’s the best practice in ExtendScript to achieve this? Should I use a global variable to check if the window exists, or is there a more robust method using window.find()?
Thanks for your help!
