Execute code after dialog displayed without user input?

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

bdeshazer

Execute code after dialog displayed without user input?

Post by bdeshazer »

Specifically, I want to display a dialog box on-screen but I need to have the active document display updated.

Calling app.refresh() first and then creating and displaying the dialog is resulting in a highly annoying 1 1/2 second delay between the time the previous operation takes place and the time that the dialog is shown to the user.

What I would like to accomplish:
1) previous action completes
2) dialog window is created and displayed
3) app.refresh() called

The onShow() handler is called prior to the window being displayed. I thought perhaps onActivate() might work but it doesn't appear to either.

The dialog window is basically a replacement for alert(), have just a read-only edittext field and a single "Ok" button.

I do not wish to rely on user input such as keyboard or mouse events.

Any ideas on what else I could try?