Hidden dialog boxes....

I have a script that utilizes Photoshop and Filemaker… at the end of the script, I am looking to have a dialog box give me a status report from the script.

However, for some reason the dialog box is always hidden by the last used application, in this case Photoshop, and can only be seen if you bring Script Editor to the forefront. Is there anyway to force a displayed dialog to the front?

Does the Script Editor or the script icon bounce in the dock? Try activating one or the other to bring it to the front.

Try something like this, Scott:

tell application (path to frontmost application as Unicode text) to display dialog "Your message here."

The problem with this approach (which is the way to go normally) is that while the dialog is unanswered, you can’t interact with the application. I have a script that pops up a dialog from the Script Editor (which is then made frontmost so I can see it) but still allows interaction with the application. Perhaps this is only an issue for dual screens where I’ve got the application on one and the dialog on the other.

I like this! Thanks!

Not sure that will matter in my instance as the dialog is simply a status report resulting from the script. And generally on a machine that will be running this script for hours when I am not sitting there.

But, your point is well taken and I will keep it in mind. Thanks.

There’s one final point to bear in mind if you leave the machine unattended for long periods, Scott. A dialog in an application tell statement will normally timeout after a couple of minutes - although it’s something that can be avoided.

There are several ways to do this. One approach is to extend the timeout period:

with timeout of days seconds
	tell application (path to frontmost application as Unicode text) to display dialog "Your message here."
end timeout

Another is to use an ‘ignoring application responses’ statement:

ignoring application responses
	tell application (path to frontmost application as Unicode text) to display dialog "Your message here."
end ignoring

Alternatively, you could simply activate the application running the script (which would not normally be subject to timeouts)…

Outside an application tell block:

activate
display dialog "Your message here."

If for some reason that’s not possible then, to achieve a similar result from within an application tell block:

tell me
	activate
	display dialog "Your message here."
end tell