Created
May 25, 2010 03:14
-
-
Save jmjeong/412710 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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