AmaltasCoder
AmaltasCoder

Reputation: 1123

Check whether an application exists on Mac from cocoa application

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

Answers (1)

Peter Hosey
Peter Hosey

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

Related Questions