Skip to content

Instantly share code, notes, and snippets.

@jmjeong
Created May 25, 2010 03:14
Show Gist options
  • Save jmjeong/412710 to your computer and use it in GitHub Desktop.
Save jmjeong/412710 to your computer and use it in GitHub Desktop.
(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:get title of \"%s\", type:html, source:\"%s\", url:\"%s\"} in current group
end tell
" content content (buffer-file-name)))
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment