【发布时间】:2014-03-05 02:43:23
【问题描述】:
我正在尝试使用具有多个按钮的对话框编写 AppleScript,每个按钮执行不同的命令。我的问题是 AppleScript 编辑器根据标题将“end if”或“else if”检测为语法错误。
例如:
set dialog to display dialog "Test" buttons {"1","2"}
set pressed to button returned of dialog
if pressed is equal to "1" then activate "Safari"
else if pressed is equal to "2" then beep
end if
AppleScript 编辑器显示错误“语法错误:预期行尾等,但发现“else if”。”
是不是我做错了什么?
【问题讨论】:
标签: macos applescript