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




On Oct 25, 2007, at 4:34 PM, Doug Zwick wrote:



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

You can make the tell the current java application that is doing a Runtime exec of osascript.


tell application "CommandWrap"
set the date_stamp to ((the current date) as string)
display dialog the date_stamp buttons {"Clipboard", "OK"} default button 2
if the button returned of the result is "Clipboard" then
set the clipboard to the date_stamp
display dialog "The date stamp is on the clipboard." buttons {"•"} giving up after 2 default button 1
end if
end tell


worked fine to display the dialog from the current CommandWrap application. (clipboard stuff also worked)

tell application "Finder" also works but you get a system beep and the Finder dock icon bounces until you select it and deal with the dialog. In other words normal notification stuff.

Mike Hall        hallmike at att dot net
http://www.geocities.com/mik3hall
http://sourceforge.net/projects/macnative



_______________________________________________
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
References: 
 >Re: how to bring appleScript's alerts to the front (From: Doug Zwick <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.