Org mode custom link types

I keep “deep” links to a few Mac apps in Emacs and want to click them in order to open specific items in those apps.

For example, I use DEVONthink for collecting PDFs and other research for projects or personal use. The DEVONthink URLs look like this:

x-devonthink-item://EB2842EA-B147-4F04-9319-F028A7DCD911

To make that a clickable link, I use org-link-set-parameters. Here’s my current setup.

1
2
3
4
5
6
7
8
(after! org
;; custom link types
(org-link-set-parameters "brain"
  :follow (lambda (path) (shell-command (concat "open brain:" path))))
(org-link-set-parameters "x-devonthink-item"
  :follow (lambda (path) (shell-command (concat "open x-devonthink-item:" path))))
(org-link-set-parameters "message"
  :follow (lambda (path) (shell-command (concat "open \"message:" path "\"")))))

I use doom-emacs , and wrapping these in (after! org ...) prevents an undefined function error I was seeing.

This configuration replaces my original complex set of Applescripts and is much cleaner.