Re: Saving, file types, and non-document-based apps
Re: Saving, file types, and non-document-based apps
- Subject: Re: Saving, file types, and non-document-based apps
- From: Yann Bizeul <email@hidden>
- Date: Wed, 12 Jan 2005 15:04:36 +0100
Ideally, I would like the files to have a custom document icon so it is clear they cam from my application. After messing around with the info.plist and nsfilewrapper most of the day, I just can't figure out what is going on. Am I missing something simple? BBEdit xml files seem to work like this.
The problem is that the Finder does not have more informations than the file extension to decide who belong the document. It seem that .xml files go to Property List Editor.
Personaly, I would try to setup target info, and define the "OS Type" column. This is the old style finder document identification mechanism, and you can setup this attribute according to this sample :
NSString *fullPath = @"/Path/to/your/doc";
NSDictionary *attributes = [[[NSFileManager defaultManager]fileAttributesAtPath:fullPath traverseLink:YES]mutableCopy];
[attributes setObject: [NSNumber numberWithUnsignedLong: 'MyFT'] forKey: NSFileHFSTypeCode];
[[NSFileManager defaultManager]changeFileAttributes:attributes atPath:fullPath];
[attributes release];
I hope that helps
(sorry for the false plain text message which is not, just for colorization :-))
--
Yann Bizeul - yann at tynsoe.org
Please use this e-mail when writing to me.
You can visit my projects at this address :
http://projects.tynsoe.org/
(BuddyPop - GeekTool - SSH Tunnel Manager...) _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden