Created
December 30, 2009 19:31
-
-
Save travis/266317 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun clean-applescript-input (s) | |
(replace-regexp-in-string | |
(regexp-quote "\"") "\\\\\"" | |
(replace-regexp-in-string | |
(regexp-quote "\\") "\\\\\\\\" s) | |
) | |
) | |
(defun omni-quick-entry (beg end) | |
(interactive "r") | |
(let ((s (split-string (buffer-substring beg end) "\n"))) | |
(do-applescript (concat | |
"tell front document of application \"OmniFocus\" | |
tell quick entry | |
make new inbox task with properties {name:\"" (clean-applescript-input (first s)) "\"," | |
"note:\"" (clean-applescript-input (mapconcat 'identity (rest s) "\n")) "\"} | |
open | |
select {inbox task 1} | |
end tell | |
end tell") | |
))) | |
;; I use C-s-w for omnifocus clipping... | |
(global-set-key (quote [C-s-268632087]) (quote omni-quick-entry)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment