Applescript错误-1700

时间:2014-09-13 20:52:40

标签: applescript

display dialog "Play game?" buttons {"Yes", "No"} with title "Play?"
if {button returned:"No"}
end if

我按下编译进行预测试,发生了这种情况:

Applescript错误

无法将{按钮返回:"否"}变为类型布尔值。

1 个答案:

答案 0 :(得分:1)

尝试:

set buttonChoice to (display dialog "Play game?" buttons {"Yes", "No"} with title "Play?")
if button returned of buttonChoice = "No" then
    return "no"
end if