Given the application path (or NSBundle to the application, etc.), is there a way to easily / efficiently determine what types of content the application can open?
My initial attempt was to read the Info.plist application file and extract the content types listed in the kUTExportedTypeDeclarationsKey section. However, there are some flaws in this approach that I could not get around.
- Not all applications use this key. For example, BBEdit does not, but instead displays a whole bunch of recognized file extensions.
- UTIs are case sensitive. Pages, for example, list
com.apple.iWork.Pages.pages as the type of exported content, but the Pages document does not have the type specified in its content type tree. The documents use com.apple.iWork.Pages.pages , which is determined by the iWork quicklook generator (in /Library/QuickLook/iWork.qlgenerator ).
Know that with some LaunchServices functions ( LSCopyApplicationURLsForURL() , LSCopyApplicationForMIMEType() , etc.) I can get applications that can open the file (or file type), but I would like to do the opposite, (I may have to resort to output analysis lsregister -dump ?)
Perhaps an easier way to formulate the question would be: given the application, what is the easiest way to find all the files that it can open?
Any suggestions?
source share