display dialog button result choice

if you have:


display dialog "Choice One" buttons { "This one" , "That one" , "Cancel" } default button 2

how can you code the result?

The code is:

Jon

There are several ways…

display dialog "Pick a Button, any Button" buttons {"1", "2", "3"} default button 2
set x to button returned of result
if x is "1" then
	display dialog "You Picked 1" default button 1
else if x = "2" then
	display dialog "You Picked 2" default button 2
else if x = "3" then
	display dialog "You Picked 3" default button 1
end if

Or

You can look inside of your AppleScript folder and open the Example Scripts folder to see many other coding examples.