• 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: Display Dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display Dialog


  • Subject: Re: Display Dialog
  • From: Mr Tea <email@hidden>
  • Date: Fri, 21 Sep 2001 21:01:59 +0100

This from Styrstr?email@hidden - dated 19/9/01 4.19 pm:

> I wonder how I get the dialog window to the front of all other running
> applications??

When you invoke 'display dialog' in a tell block, it will be displayed by
the app that the tell block is directed at, otherwise it will be displayed
by the script itself (if an applet) or by the utility that is running the
script (eg OSA menu)

If you don't know what application will be frontmost when the dialog
displays, you could try this...

set theFrontApp to name of (every process whose frontmost is true) of
application "Finder" -- [all one line]
tell application theFrontApp
display dialog "Is this what you meant?"
end tell

But this may fail if the frontmost app is not scriptable. If your dialog is
being displayed by an applet, then this...

activate
display dialog "How about this, then?"

without any tell block around it, will bring the applet to the front when it
displays the dialog. You could store the name of the app that was frontmost
in a variable before displaying the dialog (as in the first example) if you
want to bring that app back to the front when you dismiss the dialog.

(tested with AS 1.6/OS 9.1)

Mr Tea
--
"Always remember to warm the pot."

Visit the Tea Room at:
http://homepage.mac.com/mrtea/tearoom.html


References: 
 >Display Dialog (From: Styrström)

  • Prev by Date: Re: Display Dialog
  • Next by Date: What's the biggest barrier to wider AS adoption?
  • Previous by thread: Re: Display Dialog (addendum)
  • Next by thread: Re: Display Dialog
  • Index(es):
    • Date
    • Thread