November 2003
Beginner to intermediate
480 pages
15h 3m
English
display dialog — general informational, text entry, and button-choice dialog
A remarkably flexible little command. You can put up an information dialog, with a choice of standard icons. You can put up a text entry dialog, where the user can type a short string. You can dictate the names of up to three buttons, and learn which one the user pressed. The dialog can be set to time out if the user does not respond, and you can learn that this is what happened. By default, the buttons are “Cancel” and “OK”. Returns a dialog reply record containing only the relevant items. If the user presses a button entitled “Cancel”, an error is thrown (-128: “User canceled.”).
set r to display dialog "Quick! Pick a Pep Boy!" buttons {"Mannie", "Moe", "Jack"} ¬
with icon caution giving up after 3
set favoritePepBoy to button returned of r
if favoritePepBoy is "" and gave up of r then set notFastEnough to true
set whoIsIt to text returned of (display dialog "What is your name?" ¬
default answer "" buttons {"OK"} default button "OK")Read now
Unlock full access