Reputation: 303136
I know how to manually associate a specific file or generic extension with a particular OS X application. (Get Info > Open with > Other…)
I know how, in OS X, to drag-and-drop a file with an extension onto an 'unsupported' application. (Hold down command-option when dragging over the application)
As the author of an OS X application, how can I specify that my application knows how to open a particular file extension?
.app
is dragged into the Applications folder.I have seen "MacOSX - File extension associate with application - Programatically", but I do not want to have to have users run an installer or shell script after installation.
Upvotes: 5
Views: 3328
Reputation: 22930
To declare its support for file types, your app must include the CFBundleDocumentTypes key in its Info.plist
Then implement
- application:openFile: (for single file drag-drop)
or
- application:openFiles: (multiple files drag-drop)
Have a look at Complete the Information Property List section in Document-Based App Programming Guide for Mac
Upvotes: 6