So, Dr. Drang wrote (or adapted, anyhow) this handy little “open in BBEdit” button for Finder windows, and I found it intriguing because I wouldn’t mind something similar for Cocoa Emacs at all. On review of what, exactly, the button entailed, I decided I could take Dr. Drang’s work and make a working knockoff (or, as we say in Apple fandom, “samsung it”) over lunch.
After a few minutes with Icon Composer and a few more poking at the AppleScript that drives the button (see where my priorities were?), I had enough to put up on Github, where I bet you can make it better.
Here’s the README:
A very quick, still incomplete adaptation of Dr. Drang’s “Open in BBEdit” button for the Finder toolbar.
This works with the Homebrew’s Cocoa build of Emacs.
- Download and drag into your Finder toolbar
- Select file(s), click button, see files open in new frames in your Emacs app. If you’d rather they open in new buffers, add this to ~/.emacs:
(setq ns-pop-up-frames nil)
If you haven’t selected any files, it should open the directory represented by the Finder folder you’re in in dired.
- wait for things to break because this was done very quickly