Re: Prevent this double dialog
Re: Prevent this double dialog
- Subject: Re: Prevent this double dialog
- From: Brian Johnson <email@hidden>
- Date: Sun, 26 Sep 2004 08:20:57 -0700 (PDT)
On Sun, 26 Sep 2004, Gnarlodious wrote:
Let's say I use "on idle" but also "on run" in the same script. It then
executes the handler twice on startup.
How might I suppress the firstrun dialog when starting the Script
Application?
--------
on idle
beep
displayDialog()
return 20
end idle
on run
displayDialog()
end run
to displayDialog()
tell application "Finder" to set focus to name of (path to frontmost
application)
tell application focus to display dialog focus & " is frontmost" giving
up after 1 with icon note buttons {""}
end displayDialog
-- Gnarlie
In my experience with CGI apps, even when launched by a current web hit,
there was sometimes an idle event squeezed in between launch and handler
invocation. I think the script's relation to idle events is unpredictable,
so, I use the brute-force way:
property doDialog: true
on run
if doDialog then
display dialog ....
set doDialog to false
endif
end run
(and etc.)
If this is saved as an app, just remember to set doDialog back to true on
quit (or somewhere) or it's a one-shot happening.
- Brian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden