Use Automator to Append to an org-mode Inbox

September 4th, 2012  |  Published in mac and iphone, ruby

I’m pretty sure there are some org-mode modules for skinning something like this cat, but I read a tip in MacWorld today about creating reminders outside of the Reminders app using Automator and it seemed like a thing to adapt to org-mode once I’d finished my sandwich.

So … you fire up Automator and tell it you’re creating a new service, then:

  • you tell it “Service receives no input in any application”

  • you tell it “Ask for Text” and add a useful format reminder, such as “Add an item to the org-mode inbox (item |yyyy-mm-dd)”

  • you tell it “Run Shell Script,” passing input to stdin.

  • you include this script, seasoned to taste where your own org-mode inbox is concerned:

Then you save it as a decent name you don’t mind seeing in your services menu, visit the Services Preferences panel and assign it a shortcut you’ll remember, and you get a quick dialog each time you hit the shortcut key that lets you add something to your org-mode inbox.

It’s super-simple, and you need to remember to separate the todo with a pipe character (and never use a pipe character for the headline of your org-mode entry), then enter your todo date in the correct (yyyy-mm-dd) format. If you don’t add a date, it won’t try to, either.

If you’d rather it use the selected text from your current application, you can always tweak the workflow so the service “receives text” from “any application,” which will prepopulate the popup form with your selection.

For grabbing links or selections out of a small set of Mac apps and getting them into org mode, there’s always org-mac-link-grabber and there’s also the handy org-mac-message for getting links to the current selected Mail.app message into org-mode. I put that there mainly to save you from doing what I once thought seemed perfectly sensible, which is jettisoning Mail.app for GNUS.

I guess neater still, were I a “neater still” sort of fellow, would be to grab the selected text of the current application, but offer the dialog, turning the selection into plain text under the new org-mode headline.

Leave a Response

© Michael Hall, licensed under a Creative Commons Attribution-ShareAlike 3.0 United States license.