I'm doing the same thing as you under the inspiration of Roam Protocol
You can't use the built-in org-id-goto
directly, you have to custom your own org-protocol handler first. Here's the way I do:
(add-to-list 'org-protocol-protocol-alist
'("org-id" :protocol "org-id"
:function org-id-protocol-goto-org-id))
(defun org-id-protocol-goto-org-id (info)
"This handler simply goes to the org heading with given id using emacsclient.
INFO is an alist containing additional information passed by the protocol URL.
It should contain the id key, pointing to the path of the org id.
Example protocol string:
org-protocol://org-id?id=309A0509-81BE-4D51-87F4-D3F61B79EBA4"
(when-let ((id (plist-get info :id)))
(org-id-goto id))
nil)
Then, if you open link like org-protocol://org-id?id=309A0509-81BE-4D51-87F4-D3F61B79EBA4
in a web brower, it will jump directly to the heading with id 309A0509-81BE-4D51-87F4-D3F61B79EBA4
in emacs.
Also, here's a snippet for getting this kind of org-protocol link from current heading:
(defun org-id-protocol-link-copy ()
(interactive)
(org-kill-new (concat "org-protocol://org-id?id="
(org-id-copy))))
org-protocol.el
. Briefly, you need to start the emacs server in your emacs and use emacsclient to connect. Once that works, then you can try adding it to external applications. – NickD Feb 22 '19 at 11:58