Launching Org-Capture in Windows with AutoHotKey

I finally figured out how to launch org-capture from anywhere in Windows. I’m using AutoHotKey.

; org-capture
If WinExist("ahk_class Emacs")
Send ^{c}
Send {c}
Run "C:\emacs-24.0.90\bin\runemacs.exe"
WinWaitActive, emacs
Send ^{c}
Send {c}

I have Ctrl-c c set up as the org-capture shortcut. I know there’s another option through something called org-protocol that might work better.
I just got it puzzled out, so I don’t know what my mileage will be. But I’m pretty jazzed at the prospects. Comments to the code might be forthcoming.
Is this working for you? Do you have a better way to do this?

This entry was posted in emacs, tech by Paul. Bookmark the permalink.

About Paul

I’m a Detroit expat recently returned from Tokyo living in Chattanooga. I’m a consulting security professional and father of two. I promise that my views and politics are mine; not yours or my employer’s or anyone’s. I follow no party or affiliation or anything. My things are released under the Creative Commons Attribution-ShareAlike 4.0 International license unless otherwise stated.

0 thoughts on “Launching Org-Capture in Windows with AutoHotKey

  1. Much appreciation for your tip regarding AutoHotkey. It works great for me with Emacs and Org-mode capture. Thanks for the information!

  2. paul,
    thank you so much for your script, i have been using EMACS org mode since long. i was looking for global shortcut to enter TODO in emacs but couldnt find it so i switched to TODO.TXT for PIM.
    i am happy to say that i have got solution from your script.
    could you extend me a favour, i am looking for automatic recurring email to send my daily updating agenda file to my subordinates. is there any way by which i can send my org agenda txt output file to my subordinates everyday automatically.
    i have tried several programs but those can’t work behind our corporate firewall.
    thanks once again,

  3. It works well. However, when I tried launching it with a Emacs close, I had a dangling clock that I had to close out of . After I did that, it worked as designed.
    Thanks a lot!

      • Hi Paul,
        I use Orgmode to monitor how much time I use up doing a task. I “clock-in” and I “clock-out” whenever I am doing something . In this particular instance I forgot to “clock-out”. Because of this ,Orgmode gives me a “yes or no” prompt, asking if I want to continue the clock. After I cleared that up and relaunch ,your script launches perfectly.

Be nice with what you write.