How to make Finder 'Open With' work for my application (XCode, OS X)?
Posted
by Adion
on Stack Overflow
See other posts from Stack Overflow
or by Adion
Published on 2010-06-08T14:26:22Z
Indexed on
2010/06/08
14:32 UTC
Read the original article
Hit count: 133
I have created an application that is capable of playing audio files. This in itself works fine, and so does drag&drop from finder to my application.
What I would like as well, is that people can use my application from Finder using the Open With menu (or even allow them to set my application as default for a certain file type)
After a lot of searching, I found that I should configure a document type in XCode (Editing information property lists) I successfully added such a type named 'Music File', with UTI 'public.mp3' When I now right-click an MP3 file, my application is listed in the 'Open With' menu. Trying to use it, my app opens, but I get a warning message saying "The document could not be opened. App cannot open files in the 'Music File' format"
It doesn't appear to be passed through the command line as is the case in Windows. My application does support drag&drop from Finder, and this is working fine too.
I don't really know where to look next, so it would be great if anyone could point me in the right direction. My application isn't using NSDocument, so the 'Class' field doesn't apply for me I think (and according to the docs this field isn't required, but it doesn't say how to handle it without a Class)
© Stack Overflow or respective owner