■
アップルスクリプトCocoaで、何らかの処理をするのに、OK Cancelボタンのアラートなどで、確認を迫りたいとき、例えば、
display dialog "Do you really want to quit without saving datas?" buttons {"OK", "Save", "Cancel"} if button returned of result is "OK" then doOK() else if button returned of result is "Save" then doSave() else if button returned of result is "Cancel" then doCancel() end if
などとするのが簡単。