【发布时间】:2018-06-16 20:42:25
【问题描述】:
我有一点 AS,它打开一个对话框并提示用户输入,按钮选项为“取消”和“发送”(“发送”是默认按钮)。因为它是默认按钮,所以当我按下键盘上的回车键时,“发送”就会激活。当我按下键盘上的退出键时,我想激活“取消”。有没有办法将键盘键与按钮链接起来?我正在寻找一种编码解决方案而不是应用程序设置解决方案,因为这块 AS 将由另一个应用程序运行。
感谢任何帮助,示例代码如下!
set returnedThings to (display dialog ":message:" default answer "" with icon note buttons {"cancel", "send"} default button "send")
set theMsg to text returned of the returnedThings
set theBtn to button returned of returnedThings
if theBtn is "send" and theMsg is not "" then
-- do application specific tasks
end if
【问题讨论】:
标签: applescript