Skip to content

Instantly share code, notes, and snippets.

@jmjeong
Created May 20, 2010 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmjeong/407677 to your computer and use it in GitHub Desktop.
Save jmjeong/407677 to your computer and use it in GitHub Desktop.
;; Jaemok Jeong(jmjeong@gmail.com)
;;
;; [2010-05-20 Thu]
;;
;; Export org-file into html file and save it into DEVONthink Pro
(defun org-export-to-devonthink (arg)
"Call `org-export-to-devonthink` with output to a temporary buffer.
No file is created."
(interactive "P")
(let (content)
(org-export-as-html arg nil nil "*Org HTML Export*")
(switch-to-buffer "*Org HTML Export*")
(setq content (buffer-string))
(kill-buffer "*Org HTML Export*")
(setq content (replace-regexp-in-string (regexp-quote "\"") "\\\"" content t t))
(do-applescript
(format "tell application id \"com.devon-technologies.thinkpro2\"
create record with {name:\"%s\", type:html, plain text:\"%s\"} in current group
end tell
" (buffer-name) content))
)
)
(global-set-key [f8] 'org-export-to-devonthink)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment