Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NavServices - want to open 'TEXT' and .txt files - what is best way?



One of the features in my app reads in a tab-delimited text file, and processes it.

I'm doing this in Carbon (obviously, I'm writing to this list) and I'd like to find an elegant solution to my problem.

I'd like to allow the user to read in files with a file-type of 'TEXT', or any file with a ".txt", or ".text" ending.

Things like "NavCreateGetFileDialog" take a NavTypeListHandle, but I wish they'd also take an optional "NavFileExtensionListHandle" (this data-type doesn't exist, but I wish it did).

Anyway, I know that I could write an object filter for this, however, the docs on the object filter says that it "hides" objects. I'd rather not hide anything. I'd prefer that things show up grayed-out if they don't meet the criteria. The object filter just seems like overkill to me.

Then I thought of the 'plst' resource my app is using. CFBundleDocumentTypes lists various documents that can be opened by my app. Each item can list old-school file-types (i.e. 'TEXT') and newer (well, actually, really old-school) file extensions (i.e. text, txt). So, I thought, "Hmm, there must be some way to have my NavServices dialog use this somehow." If there is, I can't seem to find it.


So, I guess the question is: can I accomplish what I want to do, without using an object filter? If not, fine. I'm just trying to figure out the best way to do this.

Thanks,
-Dan.
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.