• 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: "default answer" and buttons on the same display dialog line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >"default answer" and buttons on the same display dialog line (From: Mason <email@hidden>)

  • Prev by Date: Re: "default answer" and buttons on the same display dialog line
  • Next by Date: How to read/set two Finder "display window"
  • Previous by thread: Re: "default answer" and buttons on the same display dialog line
  • Next by thread: How to read/set two Finder "display window"
  • Index(es):
    • Date
    • Thread