Reputation: 1123
How can I check from my cocoa Mac application whether an application (for example: Preview or iPhoto) exists on Mac?
I basically want to give the user an option to open an image using Preview, iPhoto but before doing that I would like to check whether these applications are present on the user's Mac.
Upvotes: 0
Views: 806
Reputation: 96323
Instead of checking for specific hard-coded applications, it'd be better to get a list of all applications that can handle the type of document you'll be passing to them. That way, if the user has installed, say, Acorn, it'll automatically show up without your having to add it to your hard-coded list.
There is also a way to do what you specifically asked for, but that is an inferior way to do what you really want to do, which is show the user all of their applications that can open the document.
Upvotes: 1