-
All replies
-
Helpful answers
-
Sep 30, 2016 6:56 PM in response to SirWafflesIIVby Niel,Here:
display dialog "Hello!" default answer "" buttons {"Hi!"}
set {x, y} to {text returned of the result, button returned of the result}
(145016)
-
Sep 30, 2016 7:25 PM in response to SirWafflesIIVby Hiroto,Hello
You may assign variable to dialog result which is indeed a record.
set r to display dialog "Hello" default answer "" set x to r's button returned set y to r's text returned -- set {x, y} to r's {button returned, text returned} -- alternative return {r, x, y}Regards,
H
-
Sep 30, 2016 9:06 PM in response to SirWafflesIIVby Camelot,For context, the result is always the result of the previous command. So in your example, when you get to the line:
set y to the text returned of the result
the result is the result of the line:
set x to the text returned of the result
and hence no longer refers to the dialog because that was too far back.
As others have pointed out, either store the result of the display dialog in a variable, so you're not bound to the one-line restriction of the result, or extract both values in one go.