In the future, I was interested to know a list of applications that can open a certain type of document. The accepted answer pointed in the right direction, but was not a complete solution as LSCopyApplicaionURLsForURL , and his brother LSCopyAllRoleHandlersForContentType returned the package identifier, not the application itself. So I still need the application:
- Way
- Display name; and
- Pictogram
Below is the code I used to get all the information:
NSArray* handlers = LSCopyAllRoleHandlersForContentType(@"com.adobe.pdf", kLSRolesAll); for (NSString* bundleIdentifier in handlers) { NSString* path = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier: bundleIdentifier]; NSString* name = [[NSFileManager defaultManager] displayNameAtPath: path]; NSImage* icon = [[NSWorkspace sharedWorkspace] iconForFile: path]; }
Bryan kyle
source share