刚刚换用微软的一款无线键盘,键盘上有 5 个快速启动按键,按下按键即可运行指定的程序。配合这一脚本使用,就能做到一键打开 OmniFocus 的快速收集窗口,实现随时记录与收集。

Update: OmniFocus 快速收集脚本 v2

AppleScript 代码如下:

set isRunning to false

tell application "System Events"
    if exists process "OmniFocus" then
        set isRunning to true
    end if
end tell

if isRunning is true then
    tell application "System Events"
        keystroke " " using {control down, option down}
        -- 按下 Qiuck Entry 快捷键
    end tell
else
    tell application "OmniFocus" to activate

    tell application "OmniFocus"
        set miniaturized of window 1 to true
    end tell

    tell application "System Events"
        keystroke " " using {control down, option down}
        -- 按下 Qiuck Entry 快捷键
    end tell
end if

顺便推荐下 cd to…,这个 App 可以在 Finder 的当前目录中打开终端。和键盘上的快速启动按键一起使用,更加方便。

对于 Alfred 2 用户,也可以直接使用 OmniFocus Inbox Task Workflow,功能与本脚本类似。

参考资料:

  1. 用AppleScript在Mac系统下实现按键精灵的功能以及在游戏中的运用
最后修改日期: 2018-05-26

留言

撰写回覆或留言

发布留言必须填写的电子邮件地址不会公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据