dialog - 启用键盘快捷键以确认 AppleScript 中的对话框
问题描述
我正在寻找一种允许用户使用键盘快捷键完成对话框条目的方法。这可能吗?
其他问题讨论了将快捷方式分配给AppleScript 对话框中的选项,而不是分配给“继续”/“确定”等按钮。
主要困难是我使用的是多行文本输入表单,因此Enter按钮只是创建一个新行,而不是像通常那样定位默认按钮。我希望cmdenter可以将其分配给默认按钮。
定义相关对话框的脚本行是:
set theResponse to display dialog "Enter tasks:" default answer "
" buttons {"Cancel", "Continue"} default button "Continue"
解决方案
⌘-Enter(在数字小键盘上)按下 Continue
推荐阅读
- swift - 如何引用现有的 HStack、VStack 和 ZStack 实例?
- python - 对于 UNEVEN 结构化数据,使用 Pandas '比较和替换'值
- jmeter - 250 个用户在 jmeter 中达到了大约 60k 的总体请求
- mysql - Laravel sql 插入无法通过 DB::unprepared 正常工作
- clang - Clang-Format 缩进类成员
- python - 如何传递在模型方法 save() 中创建的对象本身
- javascript - 取消 .on 事件监听器/回调
- azure - Terraform 启用 VM Insights
- google-apps-script - 无法运行绑定到新空白文档的琐碎应用脚本 - 获取“此应用已被阻止”
- javascript - 每当有人发布/推文时通知您的代码