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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With