Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (41 sloc) 1.53 KB
;;; org-devonthink.el - Support for links to dtp messages by their UUID
;; version 1.1, by John Wiegley <>
(require 'org)
(org-add-link-type "x-devonthink-item" 'org-dtp-open)
(defun org-dtp-open (record-location)
"Visit the dtp message with the given Message-ID."
(shell-command (concat "open x-devonthink-item:" record-location)))
(defun org-get-dtp-link (&optional given-name)
(let ((name (or given-name
(substring (do-applescript (format "
tell application \"DEVONthink Pro\"
get name of content record
end tell")) 1 -1)))
(location (substring (do-applescript (format "
tell application \"DEVONthink Pro\"
get uuid of content record
end tell")) 1 -1)))
(concat "x-devonthink-item://" location) name)))
(defun org-insert-dtp-link ()
(let (name)
(when (region-active-p)
(setq name (buffer-substring-no-properties (region-beginning)
(delete-region (region-beginning) (region-end)))
(insert (org-get-dtp-link name))))
(defun org-dtp-store-link ()
"Store a link to an dtp e-mail message by Message-ID."
(let ((link-name
:type "x-devonthink-item"
:link (cons (concat "x-devonthink-item://" link-name)
(concat "x-devonthink-item://" link-name))
:description (file-name-nondirectory link-name))))
(provide 'org-devonthink)
;;; org-devonthink.el ends here
Jump to Line
Something went wrong with that request. Please try again.