Re: Display Dialog with Title
Re: Display Dialog with Title
- Subject: Re: Display Dialog with Title
- From: Philip Aker <email@hidden>
- Date: Mon, 18 May 2009 20:53:16 -0700
On 2009-05-18, at 09:42:20, Paul Scott wrote: I couldn't get 'tell AppleScript' to work, nor 'tell application "AppleScript"' although interestingly, the latter popped up an open dictionary dialogs when syntax checking the code -- but only once. In both cases AppleScript Studio would not accept text after "with title".
I'm sorry I can't find the discussion where I learned that because when I search for 'tell AppleScript' in the archives for this list or the applescript-studio list I get a hit for almost every post. However you can see the common usage for 'tell AppleScript' in these google search results: < http://pastie.textmate.org/48215>, < http://www.foodoo.sunreal.com.au/code/misc.html>, and < http://www.mnot.net/applescript/Rename with Date.applescript>. Thing is, I remember it being used to solve some problems in AppleScript Studio for strings -- but not specifically for dialogs.
The following works in an AppleScript Studio project, but you have to watch where you put it because it seems to mess up the event loop in some handlers. For instance, I can use it in 'on awake from nib' but not in 'on became main' (because you'll get in an endless cycle of 'becoming main' when the dialog is dismissed).
on awake from nib theObject set n to name of theObject if (n is "dwind") then using terms from application "System Events" display dialog "boo" with title "ghosts" end using terms from end if end awake from nib
Indeed. But you somehow stripped out and left unaswered my underlying question.
> How do I get a dialog title?
You should be able to run the plain vanilla 'display dialog' wrapped in:
tell AppleScript
display dialog …
end tell
or run it from a separately loaded script.
Alternately, construct your own panel window in Interface Builder and give it a title.
Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@ Democracy: Two wolves and a sheep voting on lunch.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden