• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Prevent this double dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Prevent this double dialog
      • From: Gnarlodious <email@hidden>
References: 
 >Prevent this double dialog (From: Gnarlodious <email@hidden>)

  • Prev by Date: Re: Picking data from a record
  • Next by Date: Re: Prevent this double dialog
  • Previous by thread: Prevent this double dialog
  • Next by thread: Re: Prevent this double dialog
  • Index(es):
    • Date
    • Thread