How to support this blog?

To support this blog, you can hire me as an OmegaT consultant/trainer, or you can send translation and project management jobs my way.

Search the site:

Capture (really) everywhere

Capturing thoughts is an excellent first step to organizing them. And Emacs provides one of the best organization solution in the computer world: org-mode.

When you work in Emacs all the time, you can capture your thoughts and sort them in org-mode from any place thanks to a global shortcut (C-c c by default). If you do not work in Emacs all the time, you can use various shortcuts to put Emacs front and hit C-c c to open a capture template.

My solution to accelerate the process is to use AppleScript to put Emacs in the front and type the capture template opening command.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

try
tell application "System Events" to tell process "Emacs" to set frontmost to true
on error
tell application "/Path/to/Emacs.app"
activate
delay 2
end tell
end try

tell application "/Path/to/Emacs.app"
tell application "System Events"
delay 0.1
keystroke "c" using {control down}
keystroke "c"
delay 0.1
end tell

end tell

I save the above code as an application, with a name I can readily call and that won't conflict with a commonly used word on my machine. I chose ">Capture".

Once the application is saved, calling it and launching it from Spotlight is trivial. The default shortcut for Spotlight is Command+Space. Then you start typing the first characters of your application name and when it appears, you hit Enter.

On my system I hit Ctrl+Space, then >C, and Spotlight shows >Capture. I hit Enter and Emacs comes to the front and has launched the capture template selector. I'm in Emacs now and I can do whatever I want there.

You may run into an issue where Emacs gets a different key even though you ordered AppleScript to hit C-c c. Emacs comes up with an error message like "C-s-268632079 is undefined". On my machine I had 2 such undefined "keys". The trivial solution is to add the keys to your .emacs.el file so that they are associated to org-capture:

(global-set-key (kbd "<C-s-268632079>") 'org-capture)
(global-set-key (kbd "<C-s-268632067>") 'org-capture)

Et voilà! Go capture your thoughts now!

Popular, if not outdated, posts...

.docx .NET .pptx .sdf .xlsx AASync accented letters Accessibility Accessibility Inspector Alan Kay alignment Apple AppleScript ApplescriptObjC AppleTrans applications Aquamacs Arabic archive Automator backup bash BBEdit Better Call Saul bug Butler C Calculator Calendar Chinese Cocoa Command line CSV CSVConverter database defaults Devon Dictionary DITA DocBook Dock Doxygen EDICT Emacs emacs lisp ergonomics Excel external disk file formats file system File2XLIFF4j Finder Fink Font français Free software FSF Fun Get A Mac git GNU GPL Guido Van Rossum Heartsome Homebrew HTML IceCat Illustrator InDesign input system ITS iWork Japanese Java Java Properties Viewer Java Web Start json keybindings keyboard Keynote killall launchd LISA lisp locale4j localisation MacPorts Mail markdown MARTIF to TBX Converter Maxprograms Mono MS Office NeoOffice Numbers OASIS Ocelot ODF Okapi OLPC OLT OmegaT OnMyCommand oo2po OOXML Open Solaris OpenDocument OpenOffice.org OpenWordFast org-mode OSX Pages PDF PDFPen PlainCalc PO Preview programming python QA Quick Look QuickSilver QuickTime Player Rainbow RAM reggy regular expressions review rsync RTFCleaner Safari Santa Claus scanner Script Debugger Script Editor scripting scripting additions sdf2txt security Services shell shortcuts Skim sleep Smultron Snow Leopard Spaces Spanish spellchecking Spotlight SRX standards StarOffice Stingray Study SubEthaEdit Swordfish System Events System Preferences TBX TBXMaker Terminal text editing TextEdit TextMate TextWrangler The Tool Kit Time Capsule Time Machine tmutil TMX TMX Editor TMXValidator transifex Translate Toolkit translation Transmug troubleshooting TS TTX TXML UI Browser UI scripting Unix VBA vi Virtaal VirtualBox VLC W3C WebKit WHATWG Windows Wine Word WordFast wordpress writing Xcode XLIFF xml XO xslt YAML ZFS Zip