Re: Doc kind from extension

2009-06-12 Thread Nick Zitzmann
On Jun 12, 2009, at 4:21 AM, Micha Fuhrmann wrote: Will this still be available in Snow Leopard? The only people who can answer that are under NDA, but... Why wouldn't it be available, unless it's been deprecated for years? Nick Zitzmann

Re: Doc kind from extension

2009-06-12 Thread Sidney San Martín
I would hope so! Neither of those functions are marked as deprecated in the docs, so they're not going anywhere soon. -Sidney On Fri, Jun 12, 2009 at 6:21 AM, Micha Fuhrmann wrote: > Sidney thanks, > > Will this still be available in Snow Leopard? > > Michael > On 11 juin 09, at 18:17, Sidney San

Re: Doc kind from extension

2009-06-12 Thread Micha Fuhrmann
Sidney thanks, Will this still be available in Snow Leopard? Michael On 11 juin 09, at 18:17, Sidney San Martín wrote: How about this? CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, CFSTR("pdf"), NULL); NSString *name = [(NSString*)UTTypeCopyDescription(

Re: Doc kind from extension

2009-06-11 Thread Bill Monk
On Jun 11, 2009, at 11:55 AM, Sidney San Mart?n wrote: That'll work in most cases, but as discussed in http://lists.apple.com/archives/carbon-dev/2007/Nov/msg00642.html anything that Preview can open will just return Preview Document for that call. I just double-checked - I have an app that

Re: Doc kind from extension

2009-06-11 Thread Kirk Kerekes
UTIs will get you there. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: Doc kind from extension

2009-06-11 Thread Sidney San Martín
That'll work in most cases, but as discussed in http://lists.apple.com/archives/carbon-dev/2007/Nov/msg00642.html anything that Preview can open will just return Preview Document for that call. On Thu, Jun 11, 2009 at 12:07 PM, Ken Thomases wrote: > > I missed the earlier part of this discussion,

Re: Doc kind from extension

2009-06-11 Thread Sidney San Martín
How about this? CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, CFSTR("pdf"), NULL); NSString *name = [(NSString*)UTTypeCopyDescription(UTI) autorelease]; CFRelease(UTI); // name is now "Portable Document Format (PDF)" -Sidney On Thu, Jun 11, 2009 at 11:47 A

Re: Doc kind from extension

2009-06-11 Thread Ken Thomases
On Jun 11, 2009, at 10:47 AM, Micha Fuhrmann wrote: Unfortunately all I can feed it with is the file extension Any other idea? Isn't there a mapping plist between extension and Kind that exists somewhere? I missed the earlier part of this discussion, but does LSCopyKindStringForTypeIn

Re: Doc kind from extension

2009-06-11 Thread Kyle Sluder
On Thu, Jun 11, 2009 at 8:47 AM, Micha Fuhrmann wrote: > Any other idea? Isn't there a mapping plist between extension and Kind that > exists somewhere? You might want to read this document: http://developer.apple.com/documentation/Carbon/Conceptual/understanding_utis/understand_utis_intro/underst

Re: Doc kind from extension

2009-06-11 Thread Micha Fuhrmann
Unfortunately all I can feed it with is the file extension Any other idea? Isn't there a mapping plist between extension and Kind that exists somewhere? Michael On 11 juin 09, at 16:09, Graham Cox wrote: On 11/06/2009, at 11:50 PM, Micha Fuhrmann wrote: Anyone knows how to get the s

Re: Doc kind from extension

2009-06-11 Thread Graham Cox
On 11/06/2009, at 11:50 PM, Micha Fuhrmann wrote: Anyone knows how to get the system doc kind from a given extension. Not from a file, or a file path for that matter, but just from an extension. Like giving "pdf" and receiving "Portable Document Format (PDF). I've tried NSString * theTes

Doc kind from extension

2009-06-11 Thread Micha Fuhrmann
Anyone knows how to get the system doc kind from a given extension. Not from a file, or a file path for that matter, but just from an extension. Like giving "pdf" and receiving "Portable Document Format (PDF). I've tried NSString * theTest = [[NSDocumentController sharedDocumentController]