Open With TextWrangler for all files

How do I configure TextWrangler and Mac OS X, so that TextWrangler appears in "Open With…" submenu for all files, not just the text files (and other file types explicitly supported by TextWrangler)?

I don't want to configure all those non-standard extensions one by one. Also, I don't want to open unknown files in TextWrangler by default. I just would like to have an option to quickly open in TextWrangler without looking for it in "Others…"


Solution 1:

Use an Automator Service instead. The result might be even better, depending on your point of view (I created the service for the hex editor 0xED, but it should also work for TextWrangler):

enter image description here

If you like what you see in the screenshot, open /Applications/Automator.app and select to create a new Service. At the top right of the window, select "receives selected files and folders in any application" (or just Finder, your choice).

From the library, select Utilities and double-click Run Shell Script.

Configure that action to "Pass input as arguments" and replace the script text with the following:

if [ -f "$1" ] ; then
    open -a "TextWrangler" "$1"
fi

This will open the selected file using TextWrangler if it's a regular file (no symbolic link, folder, etc.)

Save as "Open in TextWrangler" and you can use it.