field and multiple buttons

Here is the basis of what I want to do…
display dialog “Please enter some data.” default answer “” buttons {“button 1”, “button 2”, “enter”} default button 3

the next line would be…
set theResult to text returned of result as text
But this will ignore which button is pushed.

Can I have three buttons and a field such that both the field is recorded as a variable and the button too. I know the following code isn’t correct, but it may explain what I am trying to accomplish…
display dialog “Please enter some data.” default answer “” buttons {“button 1”, “button 2”, “enter”} default button 3
set theButton to button returned of result as text
if theButton = “enter” then
set theResult to text returned of result as text
else, etc…

Try something like this:

display dialog "Enter text and choose a button:" default answer "" buttons {"Button 1", "Button 2", "Button 3"} default button 3
set {text returned:theInput, button returned:theButton} to result

-- or
-- set {theInput, theButton} to {text returned, button returned} of result

Bruce, that is brilliant. I couldn’t find a reference to that anywhere. Thanks!