Re: UTI and/or bundle-IDs with small letters

2017-03-03 Thread Kevin Hardman
FWIW: It is my understanding that UTIs are derived from domain names as defined in RFC 1035 (relevant portion quoted below). Nevertheless, as already quoted in a previous post it is best to use the “Testing for Equality and Conformance” APIs or the NSWorkspace’s function type(String, conFormsToT

Re: UTI and/or bundle-IDs with small letters

2017-03-02 Thread Daryle Walker
> On Mar 2, 2017, at 2:38 PM, Daryle Walker wrote: > > I’m trying out my document-based Mac app’s data-read routine, and the code it > being skipped. I actually check the typeName (i.e. the UTI) and it doesn’t > match. My bundle identifier for the app has capital letters. I base my > document

Re: UTI and/or bundle-IDs with small letters

2017-03-02 Thread Quincey Morris
On Mar 2, 2017, at 13:43 , Thaddeus Cooper wrote: > > Specifically the section titled "Testing for Equality and Conformance." I agree with your and Ben’s advice to use UTI-specific equality and conformance testing, but I’d point out that this doesn’t actually resolve the original question, whi

Re: UTI and/or bundle-IDs with small letters

2017-03-02 Thread Thaddeus Cooper
The Apple documentation is pretty good about describing how to determine if two UTIs are equal. See the documentation here:

Re: UTI and/or bundle-IDs with small letters

2017-03-02 Thread Quincey Morris
On Mar 2, 2017, at 11:38 , Daryle Walker wrote: > > I’m trying out my document-based Mac app’s data-read routine, and the code it > being skipped. I actually check the typeName (i.e. the UTI) and it doesn’t > match. My bundle identifier for the app has capital letters. I base my > document’s m

Re: UTI and/or bundle-IDs with small letters

2017-03-02 Thread Ben Kennedy
> On 02 Mar 2017, at 11:38 am, Daryle Walker wrote: > > Turns out that the system gives me the UTI in all small letters, so my > (Swift) “switch” fails and my no-matching-type code is executed. I know I > could switch my bundle ID to all small letters, but I want to know first if > this is do

Re: UTI

2016-04-04 Thread Gerriet M. Denkmann
> On 5 Apr 2016, at 10:19, Quincey Morris > wrote: > > On Apr 4, 2016, at 18:16 , Gerriet M. Denkmann wrote: >> >> The importing iOS app has both exported and imported UTI defined (not sure >> what is really needed). >> >> But when the Document Types is only “my.private.uti”, then I am not

Re: UTI

2016-04-04 Thread Quincey Morris
On Apr 4, 2016, at 18:16 , Gerriet M. Denkmann wrote: > > The importing iOS app has both exported and imported UTI defined (not sure > what is really needed). > > But when the Document Types is only “my.private.uti”, then I am not asked to > open in which app (good) but no data is received (ba

Re: UTI

2016-04-04 Thread Gerriet M. Denkmann
> On 4 Apr 2016, at 23:48, Quincey Morris > wrote: > > On Apr 4, 2016, at 08:30 , Gerriet M. Denkmann wrote: >> >> That is, how to associate a special UTI with the file? A quick follow-up: Everything works even when the importing iOS app does NOT declare exported or imported UTIs. The only

Re: UTI

2016-04-04 Thread Gerriet M. Denkmann
> On 4 Apr 2016, at 23:48, Quincey Morris > wrote: > > On Apr 4, 2016, at 08:30 , Gerriet M. Denkmann wrote: >> >> That is, how to associate a special UTI with the file? > > You first need to *define* your own UTI. Add an entry to the Exported UTIs > section of the Info pane of the OS X app

Re: UTI

2016-04-04 Thread Quincey Morris
On Apr 4, 2016, at 08:30 , Gerriet M. Denkmann wrote: > > That is, how to associate a special UTI with the file? You first need to *define* your own UTI. Add an entry to the Exported UTIs section of the Info pane of the OS X app target in Xcode. For the UTI identifier, enter a unique name usin

Re: UTI case doesn't matter sometimes?

2015-04-13 Thread Steve Mills
On Apr 13, 2015, at 15:52:48, Quincey Morris wrote: > On Apr 13, 2015, at 12:33 , Steve Mills wrote: > >> $(PRODUCT_NAME:rfc1034identifier) > > Personally, I always replace this with an explicit string on a project that’s > destined for public release. Part of it is old-fogeyism, because it

Re: UTI case doesn't matter sometimes?

2015-04-13 Thread Quincey Morris
On Apr 13, 2015, at 12:33 , Steve Mills wrote: > > And this is correct for the fileType parameter of > writeSafelyToURL:ofType:forSaveOperation:error:? The docs don't explicitly > say that fileType is a UTI, or which part of the Info.plist it comes from. > We've just come to assume it's always

Re: UTI case doesn't matter sometimes?

2015-04-13 Thread Steve Mills
On Apr 13, 2015, at 14:29:07, Ken Thomases wrote: > > Or -[NSWorkspace type:conformsToType:]. And this is correct for the fileType parameter of writeSafelyToURL:ofType:forSaveOperation:error:? The docs don't explicitly say that fileType is a UTI, or which part of the Info.plist it comes from.

Re: UTI case doesn't matter sometimes?

2015-04-13 Thread Ken Thomases
On Apr 13, 2015, at 2:17 PM, Sean McBride wrote: > On Mon, 13 Apr 2015 14:09:06 -0500, Steve Mills said: > >> So, should string comparisons be case-insensitive when comparing UTIs? >> If not, then things fail. > > Don't compare as strings, use UTTypeConformsTo(). Or -[NSWorkspace type:conforms

Re: UTI case doesn't matter sometimes?

2015-04-13 Thread Sean McBride
On Mon, 13 Apr 2015 14:09:06 -0500, Steve Mills said: >So, should string comparisons be case-insensitive when comparing UTIs? >If not, then things fail. Don't compare as strings, use UTTypeConformsTo(). Cheers, -- Sean McBride, B. En

Re: UTI not being imported?

2011-12-06 Thread Charles Srstka
On Dec 5, 2011, at 3:10 PM, C.W. Betts wrote: > I'm trying to use an imported UTI in an application, but it isn't working. > This is the UTI declared in the info.plist file: > > "http://www.apple.com/DTDs/PropertyList-1.0.dtd";> > > > UTTypeConformsTo > > public.dis

Re: UTI not being imported?

2011-12-06 Thread C.W. Betts
It is under UTImportedTypeDeclarations. I just copy-pasted the declaration without the array. On Dec 6, 2011, at 12:02 PM, Kyle Sluder wrote: > On Mon, Dec 5, 2011 at 1:10 PM, C.W. Betts wrote: >> I'm trying to use an imported UTI in an application, but it isn't working. >> This is the UTI decl

Re: UTI not being imported?

2011-12-06 Thread Kyle Sluder
On Mon, Dec 5, 2011 at 1:10 PM, C.W. Betts wrote: > I'm trying to use an imported UTI in an application, but it isn't working. > This is the UTI declared in the info.plist file: > > "http://www.apple.com/DTDs/PropertyList-1.0.dtd";> > > >        UTTypeConformsTo You can't put the UTTypeConfo

Re: UTI not being imported?

2011-12-06 Thread Sean McBride
On Mon, 5 Dec 2011 14:10:03 -0700, C.W. Betts said: >I'm trying to use an imported UTI in an application, but it isn't >working. This is the UTI declared in the info.plist file: Those are common extensions, and the UTI system does not deal well with that (see list archives). Check /System/Libra

Re: UTI in Lion

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 5:36 PM, Jayson Adams wrote: > > On Sep 23, 2011, at 2:33 PM, Charles Srstka wrote: > >> I maintain that the better solution is for LS to keep both options open in >> the case of a conflict. Instead of guessing one or another, internally >> consider it something like “eithe

Re: UTI in Lion

2011-09-23 Thread Jayson Adams
On Sep 23, 2011, at 2:33 PM, Charles Srstka wrote: > I maintain that the better solution is for LS to keep both options open in > the case of a conflict. Instead of guessing one or another, internally > consider it something like “either public.objective-c-source or > com.matlab.whatever” and

Re: UTI in Lion

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 10:27 AM, Kyle Sluder wrote: > This is not all that different from how UTIs behave now. Launch > Services employs a few extremely simple heuristics (file extension, > creator code, MIME type) and assigns a UTI to the file. > > The big difference is that the detected UTI isn't

Re: UTI in Lion

2011-09-23 Thread Kyle Sluder
On Fri, Sep 23, 2011 at 2:22 PM, Sean McBride wrote: > How does LS use MIME types?  I mean, where can LS get a file's MIME type > from?  It isn't in an xattr is it? I'm probably conflating Launch Services with Core Services here. I meant that you can use MIME types to determine a UTI. You creat

Re: UTI in Lion

2011-09-23 Thread Sean McBride
On Fri, 23 Sep 2011 08:27:07 -0700, Kyle Sluder said: >This is not all that different from how UTIs behave now. Launch >Services employs a few extremely simple heuristics (file extension, >creator code, MIME type) and assigns a UTI to the file. How does LS use MIME types? I mean, where can LS ge

Re: UTI in Lion

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 5:56 AM, Rainer Brockerhoff wrote: > Good point, Charles. On the other hand, I was in this exact situation some > years ago - not only having to list all apps, but also having to distinguish > which were Classic and which were not (and exclude command-line apps) - and > it t

Re: UTI in Lion

2011-09-23 Thread Ross Carter
On Sep 23, 2011, at 11:27 AM, Kyle Sluder wrote: > and if the user had the ability to change that recorded > value And if the app had the ability to specify the value when the file is created or saved. ___ Cocoa-dev mailing list (Cocoa-dev@lists.appl

Re: UTI in Lion

2011-09-23 Thread Sander Stoks
On Sep 23, 2011, at 5:27 PM, Kyle Sluder wrote: > On Fri, Sep 23, 2011 at 5:01 AM, Sander Stoks wrote: >> I think the way this was solved in BeOS was pretty nice. A file had a >> type/creator code there as a special attribute. A file "inherited" from a >> different platform would be sniffed b

Re: UTI in Lion

2011-09-23 Thread Kyle Sluder
On Fri, Sep 23, 2011 at 5:01 AM, Sander Stoks wrote: > I think the way this was solved in BeOS was pretty nice.  A file had a > type/creator code there as a special attribute.  A file "inherited" from a > different platform would be sniffed by a low-priority background thread, > which employed

Re: UTI in Lion

2011-09-23 Thread Sander Stoks
Sticking to the lowest common denominator only to cater for other filesystems sound like a bad idea to me - we'll be stuck with 8.3 filenames then. I think the way this was solved in BeOS was pretty nice. A file had a type/creator code there as a special attribute. A file "inherited" from a d

Re: UTI in Lion

2011-09-23 Thread Rainer Brockerhoff
On 22/09/2011, at 21:01, cocoa-dev-requ...@lists.apple.com wrote: > From: Charles Srstka > Date: 22 de setembro de 2011 19:19:04 BRT > To: "Gerriet M. Denkmann" > Cc: cocoa-dev@lists.apple.com > > A while ago someone posted on this list that they needed to list all files > that were applicatio

Re: UTI in Lion

2011-09-22 Thread Charles Srstka
On Sep 22, 2011, at 8:11 PM, Quincey Morris wrote: > On Sep 22, 2011, at 17:24 , Charles Srstka wrote: > >> Sure there can be a “new or enhanced” UTI system, as long as its (rather >> simple) interfaces continue to work with current applications. Since the >> behind-the-scenes of how the UTI sy

Re: UTI in Lion

2011-09-22 Thread Quincey Morris
On Sep 22, 2011, at 17:24 , Charles Srstka wrote: > Sure there can be a “new or enhanced” UTI system, as long as its (rather > simple) interfaces continue to work with current applications. Since the > behind-the-scenes of how the UTI system detects what types of files is > abstracted away, it

Re: UTI in Lion

2011-09-22 Thread Charles Srstka
On Sep 22, 2011, at 6:59 PM, Quincey Morris wrote: > I believe you are overlooking two points, one minor and one major: > > 1. The minor point is that *if* the "UTI system" can never change -- I mean, > if there's never going to be a new or enhanced UTI system, independently of > your imagined

Re: UTI in Lion

2011-09-22 Thread Quincey Morris
On Sep 22, 2011, at 15:48 , Charles Srstka wrote: > The idea of UTI is that you just want to handle a certain type of file; you > don’t care *how* the OS figures out that it’s that particular type of file. > If someone comes up with a newer and better way to implement file types in > the future

Re: UTI in Lion

2011-09-22 Thread Charles Srstka
On Sep 22, 2011, at 6:02 PM, Kyle Sluder wrote: > On Thu, Sep 22, 2011 at 3:48 PM, Charles Srstka > wrote: >> No, but it would no longer be an abstraction over the type system. The idea >> of UTI is that you just want to handle a certain type of file; you don’t >> care *how* the OS figures out th

Re: UTI in Lion

2011-09-22 Thread Kyle Sluder
On Thu, Sep 22, 2011 at 3:48 PM, Charles Srstka wrote: > No, but it would no longer be an abstraction over the type system. The idea > of UTI is that you just want to handle a certain type of file; you don’t > care *how* the OS figures out that it’s that particular type of file. If > someone comes

Re: UTI in Lion

2011-09-22 Thread Charles Srstka
On Sep 22, 2011, at 5:43 PM, Kyle Sluder wrote: > On Thu, Sep 22, 2011 at 3:19 PM, Charles Srstka > wrote: >> A while ago someone posted on this list that they needed to list all files >> that were applications, including old Classic apps. To do that the old way, >> you’d have to check for .app

Re: UTI in Lion

2011-09-22 Thread Kyle Sluder
On Thu, Sep 22, 2011 at 3:19 PM, Charles Srstka wrote: > A while ago someone posted on this list that they needed to list all files > that were applications, including old Classic apps. To do that the old way, > you’d have to check for .app, bundles with the package bit set and ‘APPL’ in > the

Re: UTI in Lion

2011-09-22 Thread Charles Srstka
On Sep 22, 2011, at 5:05 PM, Gerriet M. Denkmann wrote: > I guess everybody would win, if the UTI would be stored (e.g. as an extended > attribute, like the string encoding is). > > There must be some very good reason this is not done - maybe somebody could > point it out to me. That would def

Re: UTI in Lion

2011-09-22 Thread Gerriet M. Denkmann
On 23 Sep 2011, at 00:55, Sean McBride wrote: > On Wed, 21 Sep 2011 17:10:08 +0700, Gerriet M. Denkmann said: > >> So - should I just ignore all the hype about UTIs, or what? > > UTIs are quite nice, unless you deal with file formats that have conflicting > extensions. The OS basically derives

Re: UTI in Lion

2011-09-22 Thread Sean McBride
On Wed, 21 Sep 2011 17:10:08 +0700, Gerriet M. Denkmann said: >So - should I just ignore all the hype about UTIs, or what? UTIs are quite nice, unless you deal with file formats that have conflicting extensions. The OS basically derives the UTI from the extension (or HFS type as a fall back) an

Re: UTI in Lion

2011-09-21 Thread Quincey Morris
On Sep 21, 2011, at 03:10 , Gerriet M. Denkmann wrote: > I got from reading the documentation that UTIs are the modern way to go. > > NSAttributedString.h says "for reading, thNSFileTypeDocumentAttributes is > available along with NSDocumentTypeDocumentAttribute, but for writing the two > are m

Re: UTI for ScreenSaver, Automator Actions and PreferencePanes?

2010-12-18 Thread Gregory Weston
Stephane Sudre wrote: > Which UTIs are supposed to be used for CFBundleDocumentTypes > > LSItemContentTypes for : In a terminal window, you can use mdls to show you for any given file. On this 10.6.5. machine, I get: > - Screen Savers Something dynamically generated > - Automator Actions com

Re: UTI for Mach-O file

2010-08-25 Thread John Johnson
>> I guess that makes sense. But then why is there a com.apple.mach-o.binary >> and a public.unix-executable UTI in the first place?? > > Well, technically, UTIs are not just applied to on-disk files. They can be > applied to email attachments, where a MIME type might give that sort of > infor

Re: UTI for Mach-O file

2010-08-25 Thread Ken Thomases
On Aug 25, 2010, at 12:46 PM, John Johnson wrote: > Hello. I'm implementing an NSDocument-based utility that loads mach-o files > and displays information about them. But no matter what UTI I put in the > Info.plist, I can't get the app to recognize the file when dropped on the > dock tile. The

Re: UTI for Mach-O file

2010-08-25 Thread Kevin Wojniak
You could just handle all files, then once the file is selected verify it's valid, displaying an error if it's not. See: - - - http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html Kevin On Aug 25, 2010, at 10:46 AM, John Johnso

Re: UTI strings

2010-06-01 Thread John Joyce
On Jun 1, 2010, at 9:26 AM, Sean McBride wrote: > On Tue, 1 Jun 2010 00:29:54 -0500, John Joyce said: > Remember, that although creator codes are out, extensions *seem* to be recognized, and... being a BSD, there is still also the *magic number* for file >> types... (the magi

Re: UTI strings

2010-06-01 Thread Sean McBride
On Tue, 1 Jun 2010 00:29:54 -0500, John Joyce said: >>> Remember, that although creator codes are out, extensions *seem* to be >>> recognized, >>> and... being a BSD, there is still also the *magic number* for file >types... >>> (the magic file does get updated regularly) >> >> Is the magic file q

Re: UTI strings

2010-05-31 Thread John Joyce
On May 31, 2010, at 4:58 PM, Sean McBride wrote: > On Mon, 31 May 2010 10:39:38 -0500, John Joyce said: > >> Remember, that although creator codes are out, extensions *seem* to be >> recognized, >> and... being a BSD, there is still also the *magic number* for file types... >> (the magic file do

Re: UTI strings

2010-05-31 Thread Sean McBride
On Mon, 31 May 2010 10:39:38 -0500, John Joyce said: >Remember, that although creator codes are out, extensions *seem* to be >recognized, > and... being a BSD, there is still also the *magic number* for file types... >(the magic file does get updated regularly) John, Is the magic file queried wh

Re: UTI strings

2010-05-31 Thread John Joyce
On May 31, 2010, at 4:28 AM, julius wrote: > > On 31 May 2010, at 10:06, Jean-Daniel Dupas wrote: >>> >>> Can you perhaps tell me which UTI maps onto NSPlainTextDocumentType >> >> You would guess on kUTTypePlainText >> >>> and which onto NSMacSimpleTextDocumentType ? >> >> In 3 major rel

Re: UTI strings

2010-05-31 Thread julius
On 31 May 2010, at 10:06, Jean-Daniel Dupas wrote: >> >> Can you perhaps tell me which UTI maps onto NSPlainTextDocumentType > > You would guess on kUTTypePlainText > >> and which onto NSMacSimpleTextDocumentType ? > > In 3 major releases Apple didn't managed to declare UTI for modern file

Re: UTI strings

2010-05-31 Thread julius
On 31 May 2010, at 10:23, Ken Thomases wrote: > On May 31, 2010, at 4:06 AM, Jean-Daniel Dupas wrote: > >> Le 31 mai 2010 à 10:53, julius a écrit : >> >>> and which onto NSMacSimpleTextDocumentType ? >> >> In 3 major releases Apple didn't managed to declare UTI for modern file >> formats

Re: UTI strings

2010-05-31 Thread Ken Thomases
On May 31, 2010, at 4:06 AM, Jean-Daniel Dupas wrote: > Le 31 mai 2010 à 10:53, julius a écrit : > >> and which onto NSMacSimpleTextDocumentType ? > > In 3 major releases Apple didn't managed to declare UTI for modern file > formats like sdef, $ mdls foo.sdef ... kMDItemContentType

Re: UTI strings

2010-05-31 Thread Jean-Daniel Dupas
Le 31 mai 2010 à 10:53, julius a écrit : > On 31 May 2010, at 09:43, Jean-Daniel Dupas wrote: This data is covered, but you may want to explore further the docs, a few books on cocoa, and sample apps from apple. Look at how they handle this. Ideally, look at open source

Re: UTI strings

2010-05-31 Thread Ken Thomases
On May 30, 2010, at 5:15 PM, julius wrote: > On 30 May 2010, at 20:21, Ken Thomases wrote: > >> On May 30, 2010, at 1:04 PM, julius wrote: >> >>> unless of course there's a way of specifying the constants for >>> NSAttributedString using the kUTTypes that I've not found yet >> >> The Snow Leop

Re: UTI strings

2010-05-31 Thread julius
On 31 May 2010, at 09:43, Jean-Daniel Dupas wrote: >>> >>> This data is covered, but you may want to explore further the docs, a few >>> books on cocoa, and sample apps from apple. >>> Look at how they handle this. >>> Ideally, look at open source or sample apps that handle similar file types >>

Re: UTI strings

2010-05-31 Thread Jean-Daniel Dupas
Le 31 mai 2010 à 10:25, julius a écrit : > > On 31 May 2010, at 01:42, John Joyce wrote: > >> >> On May 30, 2010, at 5:15 PM, julius wrote: >> >>> John hi >>> On 30 May 2010, at 19:47, John Joyce wrote: >>> That's not how these constants work. These are intended to be constants tha

Re: UTI strings

2010-05-31 Thread julius
On 31 May 2010, at 01:42, John Joyce wrote: > > On May 30, 2010, at 5:15 PM, julius wrote: > >> John hi >> On 30 May 2010, at 19:47, John Joyce wrote: >> >>> That's not how these constants work. >>> These are intended to be constants that return the correct type for the >>> current build of t

Re: UTI strings

2010-05-30 Thread John Joyce
On May 30, 2010, at 5:15 PM, julius wrote: > John hi > On 30 May 2010, at 19:47, John Joyce wrote: > >> That's not how these constants work. >> These are intended to be constants that return the correct type for the >> current build of the system. >> This protects your software from a change in

Re: UTI strings

2010-05-30 Thread julius
Ken hi, thanks for responding. On 30 May 2010, at 20:21, Ken Thomases wrote: > On May 30, 2010, at 1:04 PM, julius wrote: > >> unless of course there's a way of specifying the constants for >> NSAttributedString using the kUTTypes that I've not found yet > > The Snow Leopard AppKit release note

Re: UTI strings

2010-05-30 Thread julius
John hi On 30 May 2010, at 19:47, John Joyce wrote: > That's not how these constants work. > These are intended to be constants that return the correct type for the > current build of the system. > This protects your software from a change in the actual UTI of a common type. > I can understand

Re: UTI strings

2010-05-30 Thread Ken Thomases
On May 30, 2010, at 1:04 PM, julius wrote: > unless of course there's a way of specifying the constants for > NSAttributedString using the kUTTypes that I've not found yet The Snow Leopard AppKit release notes include this

Re: UTI strings

2010-05-30 Thread John Joyce
That's not how these constants work. These are intended to be constants that return the correct type for the current build of the system. This protects your software from a change in the actual UTI of a common type. On May 30, 2010, at 1:04 PM, julius wrote: > Mike > Thanks, that's a great dia

Re: UTI strings

2010-05-30 Thread julius
Mike Thanks, that's a great diagram but as far as I can see it's not the kUTTypes that are for me the problem but rather just determining which UTI goes with which of the NSPlainTextDocumentType NSRTFTextDocumentType NSRTFDTextDocumentType NSMacSimpleTextDocumentType NSHTMLTextDocumentType NSD

Re: UTI strings

2010-05-30 Thread Mike Abdullah
This should give a decent overview of the main system types: http://www.mikeabdullah.net/utis_diagram/ On 30 May 2010, at 17:47, julius wrote: > Kyle Thanks > > I'm obviously missing something, what type for instance maps onto > NSPlainTextDocumentType? > I'm currently working my way down the

Re: UTI strings

2010-05-30 Thread julius
Kyle Thanks I'm obviously missing something, what type for instance maps onto NSPlainTextDocumentType? I'm currently working my way down the UTI list by a process of elimination, i.e. put a UTI into the Info.plist then try to save a document as that type and see if my choice of document type r

Re: UTI strings

2010-05-30 Thread Kyle Sluder
On Sun, May 30, 2010 at 9:22 AM, julius wrote: > I'm having difficulties finding the Uniform Type Identifier strings that > correspond to the document types associated with the > NSDocumentTypeDocumentAttribute key as specified in the NSAttributedString > Application Kit Additions Reference /S

Re: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-13 Thread Ken Ferry
On Mon, Oct 12, 2009 at 3:45 PM, Jens Alfke wrote: > > On Oct 12, 2009, at 3:36 PM, Iceberg-Dev wrote: > > Wouldn't there be an API I didn't see in Foundation that lets you obtain >> the type without having to convert, at least, a NSURL to a FSRef? >> > > In 10.5 there were a bunch of mismatches

Re: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-13 Thread Kyle Sluder
On Tue, Oct 13, 2009 at 3:30 PM, Iceberg-Dev wrote: > Unfortunately, I need a solution that is daemon-safe. If you need a daemon-safe solution, why are you so averse to using an FSRef? --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-13 Thread Iceberg-Dev
On Oct 13, 2009, at 12:42 AM, Jim Correia wrote: On Mon, Oct 12, 2009 at 6:36 PM, Iceberg-Dev wrote: From what I've found in the documentation, the UTI type of a file can be retrieved using the LaunchServices APIs. This requires to provide a FSRef. Wouldn't there be an API I didn't see

Re: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-12 Thread Jens Alfke
On Oct 12, 2009, at 3:36 PM, Iceberg-Dev wrote: Wouldn't there be an API I didn't see in Foundation that lets you obtain the type without having to convert, at least, a NSURL to a FSRef? In 10.5 there were a bunch of mismatches between APIs like this, that required clients to convert bet

Re: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-12 Thread Jim Correia
On Mon, Oct 12, 2009 at 6:36 PM, Iceberg-Dev wrote: > From what I've found in the documentation, the UTI type of a file can be > retrieved using the > LaunchServices APIs. This requires to provide a FSRef. > > Wouldn't there be an API I didn't see in Foundation that lets you obtain the > type w

Re: UTI not identified correctly for some users.

2009-06-17 Thread Sean McBride
On 6/17/09 7:07 PM, Mitchell Livingston said: >None of the apps I found have it set up in the Info.plist. From users >with the problem I've discovered they have it set up as >"com.bittorrent.torrent". Perhaps I should just change it to that, but >that's not future-proof enough incase another progr

Re: UTI not identified correctly for some users.

2009-06-17 Thread Mitchell Livingston
On Jun 16, 2009, at 6:20 PM, Sean McBride wrote: On 6/15/09 12:36 AM, Mitchell Livingston said: Thanks for that. I am dealing with .torrent extensions. I have the UTI defined as "org.bittorrent.torrent". Both apps are using the same file format, so there shouldn't be a problem with a sing

Re: UTI not identified correctly for some users.

2009-06-17 Thread Sean McBride
On 6/15/09 12:36 AM, Mitchell Livingston said: >Thanks for that. I am dealing with .torrent extensions. I have the UTI >defined as "org.bittorrent.torrent". Both apps are using the same file >format, so there shouldn't be a problem with a single UTI. OK, you're in a not-so-bad situation then. Th

Re: UTI not identified correctly for some users.

2009-06-14 Thread Mitchell Livingston
Hey Sean, Thanks for that. I am dealing with .torrent extensions. I have the UTI defined as "org.bittorrent.torrent". Both apps are using the same file format, so there shouldn't be a problem with a single UTI. It would be great if Apple included this in the OS, although is there a chance

Re: UTI not identified correctly for some users.

2009-06-12 Thread Sean McBride
Mitchell, Welcome to the wonderful world of file extensions! :) A file has one and only one UTI. The system (Launch Services aka LS) decides on a UTI based on the file's extension and HFS type (and MIME type?). So if two apps declare different UTIs that refer to the same extension, LS will pick

Re: UTI not identified correctly for some users.

2009-06-11 Thread Mitchell Livingston
As a followup to this, it appears that the users having problems do have a different app set for this file type, so it's not recognizing my UTI name for NSOpenPanel's setRequiredType: and NSWorkspace's typeOfFile:... Is there a way around this besides specifying the file extension explicitl

Re: UTI Example

2008-08-23 Thread Jonathan Dann
Reposted due to 25KB size limit. Sorry. On 23 Aug 2008, at 06:42, Adam Thorsen wrote: Are there any examples of using the UTI API to determine the UTI given a path to a file? Thanks, -Adam In my app I have a singleton UTI controller class that has an NSArray property of UTIs supported by

Re: UTI Example

2008-08-22 Thread Adam R. Maxwell
On Aug 22, 2008, at 10:42 PM, Adam Thorsen wrote: Are there any examples of using the UTI API to determine the UTI given a path to a file? On 10.4 and later, use LSCopyItemAttribute: FSRef fileRef; /* assuming valid fileRef */ CFStringRef theUTI; LSCopyItemAttribute(&fileRef, kLSRolesAll, k