Re: Getting Multiple Returns From A Dialog
Re: Getting Multiple Returns From A Dialog
- Subject: Re: Getting Multiple Returns From A Dialog
- From: Christopher Nebel <email@hidden>
- Date: Tue, 11 Mar 2003 20:30:49 -0800
On Tuesday, March 11, 2003, at 06:10 PM, Marc K. Myers wrote:
How would one go about getting multiple results from a dialog with
three buttons and a text entry box? I want to store the button
returned in a variable and the text returned in a variable.
display dialog "TEXT" default answer "42" buttons
{"one","two","three"}
set text1 to --text returned of the dialog
set button1 to --button returned of the dialog
To do it all in one line:
set {text1, button1} to (display dialog "Text" default answer "42"
buttons {"one", "two", "three"}) as list
Do not do this. Items in a record are not guaranteed to be in any
particular order, so this script is extremely vulnerable to changes in
the system. Here's a reliable way:
set {t, b} to {text returned, button returned} of (display dialog
"Text" default answer "42" buttons {"one", "two", "three"})
--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.