Hi,
I need to get a list of all applications that can open a specific file (type). I found the two functions LSCopyApplicationURLsForURL() and LSCopyAllRoleHandlersForContentType(). I would like to know what the difference is between the two - why doesn't one return the same apps as the other?
E.g. for an image file, say JPEG:
LSCopyApplicationURLsForURL(fileURL, kLSRolesViewer | kLSRolesEditor);
returns an array with the following Apps:
/Applications/Firefox.app, /Applications/Safari.app, /Applications/Utilities/ColorSync Utility.app, /Applications/Preview.app, /Applications/TextWrangler.app, /Applications/QuickTime Player.app, /Developer/Applications/Graphics Tools/Core Image Fun House.app, /Developer/Applications/Xcode.app, /Applications/RealPlayer.app, /Applications/img2icns.app, /Applications/Opera.app, /Applications/GraphicConverter.app, /Applications/BBEdit.app
whereas calling
LSCopyAllRoleHandlersForContentType(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef) @"jpg", NULL), kLSRolesViewer | kLSRolesEditor);
returns only the following identifiers:
com.apple.ColorSyncUtility, com.apple.Preview, com.apple.CoreImageFunHouse.app
How come, all the other apps are missing? Is there a way around it other than creating a fake file with a given extension and then calling LSCopyApplicationURLsForURL()?
Cheers,
Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (
email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hiddenThis email sent to
email@hidden