Re: "default answer" and buttons on the same display dialog line
Re: "default answer" and buttons on the same display dialog line
- Subject: Re: "default answer" and buttons on the same display dialog line
- From: Tim Mansour <email@hidden>
- Date: Tue, 29 Dec 2009 17:28:15 +1100
2009/12/29 Mason <email@hidden>:
> I only want one "display dialog" and I know I can set a variable to the text returned of the answer (as I did with changePrice above) or set a variable to capture the button pressed with a "set changePrice to button returned of" but I do not know how to do both using just one "display dialog"
Michelle's kindly given you the shorthand Mason but I thought it worth
pointing out that you're not obliged to get one or the other of the
items returned; you can simply ask for the whole record:
set user_response to display dialog "What is the amount?" default
answer "1.25" buttons {"Cancel", "Subtract", "Add"} default button 2
--> {text returned:"1.25", button returned:"Subtract"}
set delta to text returned of user_response
if button returned of user_response is "Subtract" then
-- do something
end if
(the wording of your post led me to believe you may have missed this point)
btw ... Happy New Year to everyone on the list!
Regards,
Tim.
--
Tim Mansour <email@hidden>
"The authors of the gospels were unlettered and ignorant men and the
teachings of Jesus have come to us mutilated, misstated and
unintelligible." -- Thomas Jefferson
_______________________________________________
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