The UNIX shell provides a host of extremely useful utilities for modifying text. This OS X Automator service makes all of them available for filtering text in all OS X applications.
This can be handy for performing quick operations, like replacing text with regular expressions, sorting lists or swapping fields around.
When triggered, the service requests a command to use for filtering, then runs the command and replaces the selected text with the result.
Some sample operations:
- Sort lines alphabetically/numerically: sort or sort -n
- Change to lowercase: tr "[:upper:]" "[:lower:]"
- Replace a spelling mistake, taking care of case: sed -E 's/([tT])eh/\1he/g'
- Re-order elements in a tab- or comma-separated list: awk '{print $2 $1}' or awk -F, '{print $2 "," $1}'
![]()
Put it in Library/Services, and it should appear in the ‘Services’ menu.



Reginald RegEx explorer
With a desperate need to debug a lengthy regular expression destined for use with the excellent RegexKitLite library, I have quickly put together a Mac OS X application.
Provide some sample input, and your regular expression, and Reginald will provide you with colour-coded output and a list of all your matches and the corresponding capture groups for your exploration. Select a match or capture group in the list to the right, and the corresponding text will be selected in the panel to the left.
Reginald is built on RegexKitLite, and so uses the ICU syntax.
It will run on Mac OS X 10.6 and above.
Download Reginald here, or access the source on GitHub.