Feb 09, '10 07:30:00AM • Contributed by: gordonlbuchanan
Often I need to edit text files that don't have any associated application. This usually occurs when I'm changing system configuration files. My original process was to Control-click on a file and then select Open with and then Other, and then search through the application folder for my text editor program. From another site, I learned that it is very easy to create Services with Automator in 10.6. So now I have a one-click process to open any file in my text favorite text editor.
Run Automator and choose the Service template. At the top right, change the drop-downs to read Service receives selected files or folders in any application. On the left, click Files & Folders in the Library column, then drag Open Finder Items (in the next column) into the work area on the right.
Change the Open With drop-down to your favorite text editor; you may have to click Other to find it. I use TextWrangler, which can open many types of files and also works well when passed a folder. Choose File » Save As from the menu, and give the Service a name. In my case, I called it Open with TextWrangler. The service will be saved in your user's /Library/Services folder.
Now you can Control-click (or right-click) on any file or folder, and at the bottom of the contextual menu, you can choose your new service.
[robg adds: This worked as described in my testing.]
