Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to bring appleScript's alerts to the front



Itia Gerbi wrote:

While running an applescript, something it shows some alerts (msg boxes)
to the user.


The problem is that since the applescript is invoked from another
application, sometimes the alerts are hidden behind the main application
and the user can't see them.


How can I bring the alerts to the front of the screen?

Each window on the Mac belongs to an application. Probably the easiest way to raise the alert window is to raise the application posting it. There is AppleScript verbiage to do this, something like:


    tell application "Xyz" to activate

If the dialog is posted by an AppleScript 'display dialog' command, then the dialog is owned by the app named by the innermost 'tell' block containing the display dialog statement. If it isn't inside a tell, well, I've never gotten osascript to display a dialog outside a tell block (and starting in 10.4 I get a meaningful error message: "execution error: No user interaction allowed. (-1713)"). I think that in that case the dialog would belong to the application executing the script, and in the case of osascript there is no GUI environment (for example, I can do it when running from the Script Editor application).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden


This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.