Enter the following into Script Editor and run it:
set frontmost of application "Finder" to true
display dialog ¬
"This dialog will cancel itself after ten seconds" giving up after 10
Why does “display dialog” hang if it’s executed by a background app?
Why doesn’t the “giving up after” just dismiss the dialog?
It eventually gives an “Apple Events timed out” error.
If you’re using a dock and allowing bounce, the script editor icon will bounce and clicking on it will bring the note forward. Otherwise, the Script Editor is stuck in the “get your attention” loop because the 10 seconds starts when the dialog is frontmost.
If you haven’t already read this elsewhere, this is how to avoid this problem:
--set frontmost of application "Finder" to true
tell me to activate
display dialog ¬
"This dialog will cancel itself after ten seconds" giving up after 10
Browser: Safari 419.3
Operating System: Mac OS X (10.4)
That explains it for me, Adam. Thanks! Makes sense now.
But your phrase, “using a dock and allowing bounce” suggests that one is able to turn off Dock bounce notifications. I don’t see that in my 10.4.9 dock prefPane. If that’s what you meant, where is the Dock bounce “notification manager” option set?
Some testing just now showed that you can’t - I was under the false impression that if you turned off startup animation you were turning it all off. Doesn’t make sense if you think about it.
The way to avoid that is to have System Events show the dialog:
set frontmost of application "Finder" to true
tell application "System Events" to display dialog "This dialog will cancel itself after ten seconds" giving up after 10
-- note that the Dialog Box will be in front but not focused - you'll have to click the button twice; once to focus it and once to dismiss it.