Section B.2. Dialog Boxes


B.2. Dialog Boxes

In HyperTalk, there are two commands for displaying dialog boxes: answer and ask. You use answer when you want to just present information onscreen, like this:

answer "Fortune cookie says: You will enjoy good health."

On the other hand, when you want to use HyperCard dialog boxes to get information, you use ask, like this:

ask "How old are you?" put it into theAge --The variable "theAge" now holds your dialog box response

In AppleScript, however, you use the display dialog command to accomplish both tasks, like this:

display dialog "Fortune cookie says: You will enjoy good health." set theAge to the text returned of (display dialog "How old are you?" ¬         default answer "")



AppleScript. The Missing Manual
AppleScript: The Missing Manual
ISBN: 0596008503
EAN: 2147483647
Year: 2003
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net