Alfred Extension: Open in BBEdit
The problem
Often I download some text or source files and would like to look at them in BBEdit. Or I’ve used the Finder or Spotlight to locate the source code for that web project I wanted to resume working with them in BBEdit.
In this situation I’m already seeing the files in the Finder. To bring them into BBEdit, I need to right click and pick BBEdit from a list of apps presented by the “Open With” menu; or I need to open BBEdit and navigate again to the folder containing those files; or some such fiddling about.
That’s tedious, slow, and error prone.
Alfred offers a solution
It would be much nicer to just type a few keystrokes to accomplish the same thing. It could be faster and it could be more accurate.
Alfred is a powerful launcher for applications, scripts, utilities, and other automated actions in OS X. You drive Alfred with short keywords. For instance, I launch Firefox by just typing four keystrokes: option-space
, f
, i
, return
; I launch Carbon Copy Cloner by just typing three keystrokes: option-space
, c
, return
.
I wanted to use Alfred to cause BBEdit to open the files or folders selected in the Finder. Because I have the Alfred Powerpack, I can install or create extensions to Alfred, and an extension is just what I needed. After looking around for such an extension and not finding any, I decided to write my own.
I did it in AppleScript, mainly because I needed to ask the Finder for its current folder or current selection. It did not take very long to do, and works quite well.
Now, when I want BBEdit to open a folder from the Finder, I use Alfred and simply type “obb”, hit return, and it’s done. If I won’t to open one or several selected files, I just type “obb s” (the ‘s’ means open the selection, not the current folder) and hit return. Works every time.
Downloading the extension
I’ve made the Open in BBEdit extension available to all on GitHub. The README.md
displayed there describes how to install and use the extension. Or you can download the git repository directly.
Feedback
If you try this and wish it would do something differently or something more, please let me know here or via GitHub.