0

Besides LSCopyDefaultApplicationURLForURL there exists LSCopyApplicationURLsForURL to get all applications, not just the default one.

If you just want to get default applications for a MIME type, there is LSCopyDefaultApplicationURLForContentType, but it doesn't seem to have an equivalent to get all supported applications.

How can I get all supported applications for a MIME type, without having an actual file on disk?

  • 2
    I think `LSCopyAllRoleHandlersForContentType` might be what you're looking for. – James Bucanek Apr 26 '19 at 01:53
  • Looks that way. Thanks! (if I were you I would have posted that as an answer and collected that sweet sweet rep nectar) –  Apr 26 '19 at 13:54
  • Well, honestly, I wasn't 100% sure that was the answer. ;) But it if is, I'll take the credit ... answer posting shortly. – James Bucanek Apr 26 '19 at 16:47

1 Answers1

1

The LSCopyAllRoleHandlersForContentType will return a list of application bundle IDs that are registered to handle a particular content type (using a UTI).

The logical difference between this function and LSCopyApplicationURLsForURL is that the list can be filtered to just those applications that handle said content in a particular way (display-only, edit, etc.). If you want all of the applications, pass kLSRolesAll.

To obtain the actual application URL(s), call LSCopyApplicationURLsForBundleIdentifier with one of the returned app IDs.

James Bucanek
  • 3,299
  • 3
  • 14
  • 30