How does Mac OS X know what program to open when you double click on a file?
January 31, 2006 1:41 PM   Subscribe

How does Mac OS X know what program to open when you double click on a file?

I'm sure there's some kind of database file somewhere that associates the file name extension or the resource fork with the application, but where is that file? And when I install or drag and drop an application to my drive, how or when does the app tell the Finder 'hey i'm here! I can open these sort of applications!'.
posted by sammich to Computers & Internet (6 answers total)
 
Best answer: It's called Launch Services.

1) See the section above on the Launch Services database.
2) Applications are automatically registered just by being on your disk. Right click the app and choose "Show Bundle Contents". There's a file called info.plist that contains all the data.
posted by cillit bang at 1:49 PM on January 31, 2006


From what I understand, OS X decides by both file extension AND metadata (which is why if you get a .doc from a friend who edited it in TextEdit, it will have TextEdit's icon, not Word's.) Not sure how the precedence works exactly, though. What I do know is that it makes it damn hard to get consistent results for every file of a particular type.
posted by tweebiscuit at 1:57 PM on January 31, 2006


There are programs that can change this after the fact, by the way -- you can do it in the Finder, of course (by doing Get Info on a document, selecting the application that should open it, and clicking Change All). If you'd like to have full control over the Launch Services database in one place, install RCDefaultApp.
posted by kindall at 1:58 PM on January 31, 2006


man 1 file
posted by devilsbrigade at 2:13 PM on January 31, 2006


If you are asking for the purpose of changing the program that opens the file, Select the file and select File> Get info. Then, under Opens with... select the program you want to use and then click the button below that says something to the effect of "Apply to all."

Incidentally, for internet protocols there is a separate Preference Pane you can download called More Internet.
posted by jxpx777 at 2:50 PM on January 31, 2006


RCDefaultApp is the only reliable way for a normal user to change these settings.

The Opens with... thing in the Finder's Get Info rarely works when you try to apply the setting to all files of that type.
posted by blasdelf at 8:10 PM on January 31, 2006


« Older What are the best political websites?   |   Help me destroy a junk car and my electoral... Newer »
This thread is closed to new comments.