Re: Opening old Mac files without filename extensions
Re: Opening old Mac files without filename extensions
- Subject: Re: Opening old Mac files without filename extensions
- From: Chris Meyer <email@hidden>
- Date: Fri, 4 May 2001 08:40:43 -0700
[I already posted this to the mac-os-x-dev list on OmniGroup; but
here is the message in progress. CAN ANYONE HELP????]
I'm wondering about the open panel. And my application is NSDocument
based. I've never gotten this to work.
This problem is really easy to reproduce:
1 - Create a new Cocoa Document-based Application in PB
2 - Click on 'Targets' tab, then on the target, then select
Application Settings
3 - Change the '????' to 'TEXT' for the 'Types' column in the Document Type.
4 - Build and Run.
5 - Try to open a TEXT file.
This doesn't work on my system. As far as I can tell, this SHOULD work.
(If this works on your system, please send me the project so I can
try it here and see what I'm doing wrong!!!)
At 4:16 PM -0700 5/2/01, Ali Ozer wrote:
Is this when double-clicking in Finder, or using the open panel?
When double-clicking in Finder, some other considerations come into
play, such as the creator code in the document. Currently this
always takes precedence, as the creator code is assumed to indicate
a strong-binding between the document and the given app. So, if you
have a creator code in the documents, the new app will not be
launched unless you give it the same app signature as the old
version of the app.
This creator-code strong binding can't be overridden in 10.0.
However, note that dragging the document to the new app should work
(that is, the app icon should highlight and open the document), and
that is one workaround to this creator code issue.
If you are wondering about the open panel within the app... If your
app is NSDocument based, it should load the extension and Mac OS
file type from the Info.plist, and use it automatically (thus
allowing choosing of extensionless documents). If your app is not
NSDocument based, you probably call -[NSOpenPanel
runModalForTypes:...] or something similar. Here, in addition to the
extensions, provide the Mac OS file types using the new "HFS file
type" APIs discussed in the Foundation release notes.
Ali
On Wednesday, May 2, 2001, at 12:17 PM, Chris Meyer wrote:
Does anyone know how to use the CFBundleTypeOSTypes key to allow
opening of old files without filename extensions (but with type
codes from OS 9) ???
I need some help getting my application to open files without
filename extensions. I've added the 'CFBundleTypeOSTypes' key but
my application doesn't recognize the files.
For testing: if I add the extension to a particular file, it opens correctly.
Here's an excerpt from my Info.plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
</array>
<key>CFBundleTypeName</key>
<string>Text files</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>NSDocumentClass</key>
<string>MyTextDocument</string>
</dict>
</array>
_______________________________________________
MacOSX-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/macosx-dev