Prefixr Text Filter for BBEdit
Intro
In BBEdit, Text Filters accept the selection range (or entire document, if no selection) as input, and return text that replaces the selection range (or document). They may contain Unix scripts, AppleScript files, text factories, and Automator workflows.
Text filters are saved in one of the following directories:
- ~/Library/Application Support/BBEdit/Text Filters
- ~/Dropbox/Application Support/BBEdit/Text Filters
To use a Text Filter, select Apply Text Filter from the Text menu or assign it a keyboard shortcut from the Preferences > Menus & Shortcuts > Text > Text Filters
The Filter
Prefixr is a great web service with a simple API that will accept a CSS3 input and return the cross-browser compatibility format for that input.
Their API documentation had several example uses with certain text editors but no BBEdit.
- Command Line / Terminal
- TextMate
- Espresso
- Vim
- Alfred
- Coda
- Phing (Build Script)
I decided to write my first BBEdit text filter by modifying the code for the Command Line example.
You can download the filter here: Prefixr CSS
Extract the file to one of the afore mentioned Text Filter directories and assign it a keyboard shortcut if you so choose.
I gave this filter a keyboard shortcut of ^⌥⌘+P simply because it was available.
Check out the video below to see the text filter in action, it demonstrates processing selected text as well as processing the entire document.
-
http://twitter.com/Kisa Graham Hibbert
-
http://dtheory.com david rosenfeld

