可能的重复:
使用键盘快捷键启动 OS X 应用程序
是否可以定义全局热键来显示/隐藏 OS X 中的特定应用程序?
例如,我希望能够使用Cmd+显示/隐藏 Safari Space。
打开Automator,选择创建一个服务,配置让它在任何应用程序中都没有输入。
从库中,双击Utilities » Run AppleScript并在大文本区域中输入以下内容:
on run {input, parameters}
tell application "System Events"
set names to name of application processes
if names contains "Safari" then
tell application process "Safari"
if visible then
set visible to false
else
# use the following to simply have it reappear:
set visible to true
# use the following to focus Safari:
tell application "Safari" to activate
end if
end tell
else
display dialog "Safari is not running"
end if
end tell
return input
end run
Run Code Online (Sandbox Code Playgroud)
以任何名称保存。在系统偏好设置»键盘»键盘快捷键»服务中分配键盘快捷键。请记住禁用 Spotlight 快捷方式Cmd-Space。
| 归档时间: |
|
| 查看次数: |
4191 次 |
| 最近记录: |