I have a dialog box that has two buttons, "OK" and "Cancel", I'd like to have the "OK" button launch a website, and the cancel button will stop the script. Right now both the "OK and "Cancel" buttons are launching the website. What am I missing here?
osascript -e 'tell app "System Events" to display dialog "Things are broke \r \rPress OK to launch Google" buttons {"Cancel", "OK"}'
if [ "button returned:OK" ]; then
open "http://www.google.com"
else
exit 0
fi