xuchunyang / setup-org-protocol-on-mac

Setting Up org-protocol on Mac
64 stars 6 forks source link

[[http://orgmode.org/worg/org-contrib/org-protocol.html#orgheadline6][org-protocol.el – Mac OS X setup]] doesn't work anymore according to [[https://github.com/neil-smithline-elisp/EmacsClient.app/issues/3][Issue #3 · neil-smithline-elisp/EmacsClient.app]].

** Step 1. Create an application

+BEGIN_SRC applescript

on open location this_URL do shell script "/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_14/emacsclient \"" & this_URL & "\"" tell application "Emacs" to activate end open location

+END_SRC

** Step 2. Configure the application

+BEGIN_SRC xml

CFBundleURLTypes CFBundleURLName org-protocol handler CFBundleURLSchemes org-protocol

+END_SRC

** Step 3. Test your results

See http://orgmode.org/worg/org-contrib/org-protocol.html#orgheadline8

** Emacs doesn't activate?

I use graphical Emacs and start Emacs server from there, however after clicking some org-protocol link, Emacs doesn't activate. I don't know the cause. If you encounter the same issue AND don't like it, you can try this instead

+BEGIN_SRC applescript

on open location this_URL do shell script "/usr/local/bin/emacsclient \"" & this_URL & "\" && open -a Emacs" end open location

+END_SRC

** User Script

On web browser, besides bookmarklets, you can also use User Script, for example, [[./org-protocol.user.js]] binds two keys to Org: store-link and Org: capture.