Is it possible to get a list of applications installed on the users computer that could be used to open a file (in my case an image), similar to the list shown through the Finder's "Open With..." menu?
Asked
Active
Viewed 828 times
4
-
To clarify.. I was looking for a scripting Cocoa/Carbon solution. Thank's Rob! – Harry Jordan Jun 27 '09 at 01:07
1 Answers
7
Are you looking for a programatic or scripting solution? Programatically, look at Launch Services (LSCopyAllRoleHandlersForContentType()
for instance). For scripting, you probably want lsregister
which is buried down in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Support
Don't let its location in the docs fool you. It in the Carbon docs, but it's actually CoreServices, which is not deprecated.

Alex Martelli
- 854,459
- 170
- 1,222
- 1,395

Rob Napier
- 286,113
- 34
- 456
- 610
-
1I've found LSCopyApplicationURLsForURL() to be more useful, because it includes Carbon applications as well as Cocoa. When inspecting a jpeg file LSCopyAllRoleHandlersForContentType() was returning about 7 app identifiers, whereas LSCopyApplicationURLsForURL() found 27. – Harry Jordan Jun 27 '09 at 11:40