I found your example a really useful jumping off point. I wanted to do something a bit different, which was be able to select a region in emacs and have it pop up in the OmniFocus Quick Entry window to add a new task. More details about why I wanted to do that can be found here:
http://timprouty-tech.blogspot.com/2...rom-emacs.html
Here's the code:
Code:
(defun omniQuickEntry (beg end)
(interactive "r")
(do-applescript (concat
"tell front document of application \"OmniFocus\"
tell quick entry
make new inbox task with properties {name:\""
(buffer-substring beg end) "\"}
activate
select {inbox task 1}
end tell
end tell")
))
(global-set-key "\C-c\C-o" 'omniQuickEntry)