File association for editing on a mac

5

1

I'm quite experienced with how file association works for opening files on Mac OS X.
I recall reading somewhere that OS X keeps not only the information about which apps can open a file, but also which apps can edit a specific file type.
I'm having problems with those applications (Coda, Espresso, Forklift, Flow) that have an “edit with external editor” feature, since issuing this command on HTML files opens them with Dashcode. Dashcode of course is not the current association for opening these files (Safari is), so it's clearly looking for apps that can edit HTML.

Since I'd like to use TextMate as my editor in these cases, how can I set this preference?

Agos

Posted 2009-08-03T19:42:58.923

Reputation: 251

This is a great question! – Matthew Schinckel – 2009-08-04T13:29:17.400

See also: http://superuser.com/questions/20822/where-does-mac-os-x-store-file-association-information (slightly different - but also likely to be relevant).

– Jonathan Leffler – 2009-09-16T04:58:25.713

Answers

2

There is this utility magic-launch that lets you set up rules for what you'd like done with certain files.

Peter Tomlins

Posted 2009-08-03T19:42:58.923

Reputation: 36

3

This is managed by a system service called LaunchServices. There is no direct UI to make bulk changes, but you can adjust a single file type at a time as follows:

  1. Select any file of the type whose association you want to adjust (let's say the file is called "foo.myType", and you want all "myType" files to open in Photoshop.)
  2. Choose File->Get Info or hit Cmd-I.
  3. Click the disclosure triangle on the subpanel "Open with:".
  4. Pull down the dropdown box and select the app you want to use. If you don't see the app you want to use, select "Other".

  5. Hit "Change all" to change the association for all files of that type.

Hope that helps.

peterb

Posted 2009-08-03T19:42:58.923

Reputation: 591

Alt-Secondary Click on a file gives you "Always Open With..." ... it does the same as Cmd-i, Change all. But without n dialogs. – ocodo – 2012-07-03T02:34:01.167

2

Each of those appropriate applications (Coda, Espresso, Forklift, Flow) will have a preference to say which external editor to use. For example in Flow it's available in the Editing section of the preferences window.

For changing the system default your best bet is to try updating the Launch Services database using peterb's answer.

Chealion

Posted 2009-08-03T19:42:58.923

Reputation: 22 932

1

On my installation of Coda, TextWrangler appears as my preferred editor of choice when selecting an external editor. (I assume that if I threw TextMate on the system, it would also show up).

If you're having issues with file associations, I reccomend installing RCDefaultApp. It installs to System Preferences, and provides an easier way to set file associations than via the file type (which may or may not hold in some cases).

You should be able to add TextMate to the file types you want to edit, and then it should show up when you right click on a file.

Hope this helps!

EvilChookie

Posted 2009-08-03T19:42:58.923

Reputation: 4 519

I already tried RCDefaultApp, but it only sets preferences for opening, not editing files: in facts it tells me that Dashcode is not set to open any file. Textmate does appear in the contextual menu for opening, the problem is that I can't set the preference for the default editor. – Agos – 2009-08-03T20:21:27.020

What is the file extension that you're trying to work with? – EvilChookie – 2009-08-03T20:33:14.357

1

TextMate allows for editing files within other apps using the "Edit in TextMate…" plugin. It isn't quite what you want (and would only allow you to edit in TM, not other editors, for instance), but may solve the problem for now.

You can install this, and then the menu will appear in all apps. Search the help menu for "Edit in TextMate"

Matthew Schinckel

Posted 2009-08-03T19:42:58.923

Reputation: 629