Mac下新建任意程序的快捷键

1.第一步 打开 Automator.app

2. 选择 新建,然后选择 服务

3.服务收到 选择为 没有输入

4.然后在左边侧栏中选择  运行 AppleScript

5.在编辑区输入如下:

on run {input, parameters}

(* Your script goes here *)

tell application “Terminal”

reopen

activate

end tell

end run

这样 AppleScript 就写好了,并将其保存为Terminal
只需将脚本中的 tell application “Terminal” 中的 “Terminal” 改为其他的程序名,就可以为其它的程序建立快捷键
5.设置快捷键—-在偏好设置—-键盘中快捷键设置

在键盘快捷键设置的左侧栏中选中 服务 ,可以看到Terminal ,然后完成快捷键的设置。 我的终端快捷键是“option+commond+x”