Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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…"

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
    
My solution doesn't work with .webloc files though (i.e. those created by drag&dropping e.g. from Safari's address bar). But that's a bug with open, since e.g. open -t url.webloc doesn't open in TextEdit. –  Daniel Beck Apr 13 '11 at 7:54
    
I think TextWrangler installs a service like this for you. Even easier :) –  Nathan Grigg May 18 '11 at 20:38
    
It did not when I installed it a few months ago. This script combined with the Get Info/Open With solution (to get the double-click shortcut) for specific file suffixes covers all my needs, so thanks for this :) –  Henrik Erlandsson Mar 20 '13 at 10:10
    
How did you get the services out of the services submenu? –  fzwo Jul 17 '14 at 10:03
    
To answer my own comment: If there are fewer than five services available for a file, the services are displayed as in your screenshots. Five or more services, they go into a submenu. –  fzwo Jul 17 '14 at 10:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.