Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Possible Duplicate:
How to permanently put TextEdit in the Open with… menu list?

Being a programmer, I often work with text files. As you probably know, file extensions are more or less meaningless; therefore, many text files I work with don't have the standard .txt extension.

Usually I use the Terminal so all is well, but it's a huge pain to open these text files outside of Terminal, because OS X doesn't think they are text files based on the extension.

So every time I have to do right click-Open With-Other-look for text editor-Open.

Is there a way to force OS X to always display my text editor in the Open With list?

share|improve this question

marked as duplicate by ؘؘؘ, patrix, daviesgeek, Gerry, jmlumpkin Sep 3 '12 at 14:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

You can add an action to the context menu to do this, with OS X's Services feature. Depending on your text editor (I'm pretty sure BBEdit offers this), there may already be pre-installed services available, you may just have to activate them.

To manage your services, open the Keyboard pane in System Preferences, and select Services from the left hand pane in the Keyboard Shortcuts section. You'll get a long list of services, each with a checkbox (to enable them), and the option to set a shortcut key. Check this list (probably in the Files and Folders section) for a service from your editor. If you find one, make sure the box is checked to enable it, and you should be able to access it in the context menu when you right-click a file (or a hotkey if you set one).

If you don't find a pre-made service, you can make one easily.

  • Open Automator, and select Service as the document type.
  • Change the options at the top to read "Service receives selected files or folders in any application" (change the last part to the Finder if you prefer).
  • Add the Open Finder Items action into your workflow, and change the Open with: drop down to your text editor.
  • Save, and it will prompt you for a name (which gets displayed in the menu). The actual service file gets saved in ~/Library/Application Support/ if you need to access it later.
share|improve this answer
    
The custom service is great, thanks! But is there any way to make it appear next to the open with menu item? Right now it's right at the bottom of the menu, which is a huge improvement over nothing, but still a bit inconvenient as I have to scroll down the whole list. –  houbysoft Aug 31 '12 at 21:16
    
Unfortunately not that I know of. The list is based on what file types the applications themselves say they can open. Chances are the editor registered as being able to open text files, but obviously that leaves you stuck if the system doesn't recognize something as a text file. I don't know of a way to change what the app registers as without having access to the source code and making your own customization. –  robmathers Aug 31 '12 at 22:34
    
You can edit the CFBundleDocumentTypes array in an Info.plist. Adding UTIs like public.data or public.item doesn't seem to have any effect. public.plain-text would apply to text files without an extension. –  ؘؘؘ Sep 1 '12 at 7:48

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