• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retrieving Uniform Type Identifiers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retrieving Uniform Type Identifiers


  • Subject: Re: Retrieving Uniform Type Identifiers
  • From: Dave DeLong <email@hidden>
  • Date: Mon, 26 Jul 2010 16:59:37 -0600

Yeah, I'm actually trying to expand Spotlight queries into a different format so I can execute them on a SQLite database, and the process doing this is a root-level daemon, which means I can't use NSMetadataQuery, because it returns different results when run as root versus when run as a user.

The lsregister -dump option is intriguing, and as a worst-case scenario, I could execute that via NSTask and parse out the results (though this would definitely be a last resort).

Thanks,

Dave

On Jul 26, 2010, at 4:54 PM, Ken Thomases wrote:

> On Jul 26, 2010, at 5:20 PM, Dave DeLong wrote:
>
>> I have the string "com.apple.iwork.*", and I need to expand that into any UTIs that match the string.  In this case, it'd be:
>>
>> (
>> "com.apple.iwork.pages.pages",
>> "com.apple.iwork.keynote.key",
>> "com.apple.iwork.numbers.numbers"
>> )
>>
>> The root question I have is:  How can I retrieve a list of all known UTIs?
>
> I don't have a direct answer for you.  It may not be possible.
>
> Depending on what you're trying to do, you may be able to actually use the wildcard version.  For example, the shell command:
>
> mdfind 'kMDItemContentType == "com.apple.iwork.*"'
>
> works, as should the comparable NSMetadataQuery-based code.
>
> There's also this:
>
> /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump
>
> which includes the info you're looking for.
>
> Cheers,
> Ken
>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Retrieving Uniform Type Identifiers
      • From: Ken Thomases <email@hidden>
References: 
 >Retrieving Uniform Type Identifiers (From: Dave DeLong <email@hidden>)
 >Re: Retrieving Uniform Type Identifiers (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Retrieving Uniform Type Identifiers
  • Next by Date: Re: Retrieving Uniform Type Identifiers
  • Previous by thread: Re: Retrieving Uniform Type Identifiers
  • Next by thread: Re: Retrieving Uniform Type Identifiers
  • Index(es):
    • Date
    • Thread