• 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: Type/Creator codes for RTFD Documents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Type/Creator codes for RTFD Documents


  • Subject: Re: Type/Creator codes for RTFD Documents
  • From: Tod Cunningham <email@hidden>
  • Date: Tue, 10 Feb 2004 23:25:24 -0500

Tim:

Thanks for the quick response, that really looked like the right path to follow, but I still couldn't get it to work. First I tried adding the PkgInfo file to the Contents directory. The PkgInfo file was simple enough, so I used vi to create the file containing "EntXRTFD" (my document creator & type code). That did work even through a reboot to try to flush finder cashes.

Finally, I tried adding a Info.plist file to the Contents directory and still no luck.

Can these be added manually through a Terminal window or is there some other flag that I have to set for the OS to pickup these settings? Any other ideas?

Thanks,

Tod Cunningham

--- Contents of Info.plist ---

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundlePackageType</key>
<string>EntX</string>
<key>CFBundleSignature</key>
<string>RTFD</string>
</dict>
</plist>




On Feb 9, 2004, at 10:41 PM, Timothy Carl Buchheim wrote:

I traced this down to the fact that RTFD is really a directory created with a file wrapper (RTFDFileWrapperFromRange) that really produces a directory of files. Seeing how the RTFD is really a directory it isn't allowing the type/creator attribute information. I have two questions:


1. Why is fileAttributesToWriteToFile still getting called?

there are other attributes (such as timestamps) which do apply to directories


2. How do I give the RTFD a custom icon and associated it with the
application that created it?

You should be able to make a foo.rtfd/Contents/Info.plist file with appropriate values for the CFBundlePackageType and CFBundleSignature keys (and, optionally, put the codes in foo.rtfd/Contents/PkgInfo)


See the following documentation:
http://developer.apple.com/documentation/MacOSX/Conceptual/ BPRuntimeConfig/Tasks/ConfigApplications.html
http://developer.apple.com/documentation/CoreFoundation/Conceptual/ CFBundles/Concepts/anatomy.html

As far as I can tell, setting the filetype/creator this way works for document bundles as well as application bundles.



For example, I created an RTFD file (foobar.rtfd) with TextEdit and then created a foobar.rtfd/Contents directory, and then wrote "RTFDxcde" to the file foobar.rtfd/Contents/PkgInfo

The finder now opens my file in Xcode when I double click it.



--
Tim Buchheim System Administrator
Computer Science Department Phone: (909) 607-3485
Harvey Mudd College Fax: (909) 607-8364
1250 N Dartmouth Ave E-mail: email@hidden
Claremont, CA 91711 http://www.cs.hmc.edu/~tcb/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Type/Creator codes for RTFD Documents
      • From: Timothy Carl Buchheim <email@hidden>
  • Prev by Date: At my wits end with NSSound!
  • Next by Date: Re: At my wits end with NSSound!
  • Previous by thread: re: Type/Creator codes for RTFD Documents
  • Next by thread: Re: Type/Creator codes for RTFD Documents
  • Index(es):
    • Date
    • Thread