Org Capture from Anywhere Within macOS

One of the most useful workflow enhancements I’ve made to Emacs is the ability to do initiate an Org capture whether or not I’m in Emacs. That’s important to me because virtually every note I take is stored in Org. For example, if I’m reading something in my browser and it gives me an idea for a blog post, I just press F9 and it pops up my capture template menu. From there, I need only specify b and I get my blog capture template with the URL of the site I was reading already filled in. Similarly, if I want to make a journal entry, I just press F9 j and I get a template complete with a date/time stamp.

Aimé Bertrand also depends on Org capture and has a post that describes how he initiates an Org capture from anywhere within macOS. He has some bespoke Elisp that pops up the capture menu and some advice to org-capture-finalize and org-capture-destroy to delete the capture buffer when the capture is done or aborted.

He uses Automator.app to invoke his code as a macOS service. I used to do that but found it to be unreliable. Sometimes it just wouldn’t work when I pressed the hotkey. After trying various things, I settled upon Adam Porter’s (alphapappa) yequake to handle the buffers for me and iCanHazShortcut to map F9 to the call to emacsclient and yequake. I wrote about that here.

My solution seems a bit more complicated but has the advantage of working on any system. I could, I suppose, use Bertrand’s Elisp code along with iCanHazShortcut to get rid of one dependency but yequake is working well for me so I’ll stick with my current solution.

If you’re interested in invoking Org capture from anywhere on your system, take a look at Bertrand’s post. Even if you’re not on macOS, you can use his code and something like iCanHazShortcut to handle the invocation.

This entry was posted in General and tagged , . Bookmark the permalink.