On Jun 11, 2006, at 6:50 PM, Charles Higgins wrote:
Hi, thanks for reading this post.
I'd like to create a document bundle programmatically but have a
question.
I'd like to hide the extension at creation time but don't see a way to
do that.
LSSetExtensionHiddenForRef/URL
Of course, I don't mind if the user sets to show the extension
in the Finder after it is created but I don't want to confuse the user
otherwise.
What kind of confusion are you trying to avoid? Consider not hiding
it and respecting the user's Finder preference to show or hide
extensions, unless you have a reason not to do that. As a user who
has his Finder preference to show all extensions turned on, I find it
confusing and annoying when software hides them.
I notice that the extension used by Keynote document bundles are
hidden but bundles with the generic .bundle extension are not. So I
see
two choices: either set the bundle bit for the directory or register
the extension with the OS.
The problem with the first solution is that in "Finder.h" kHasBundle
has a note that says it pertains to files only. Is this true? Is this
the correct bit to set for a directory? The Bundle Programming
Guide says there is a bundle bit for directories. Is this true?
That bit is not used in Mac OS X if I recall correctly.
For the second solution, I don't mind using the generic .bundle
extension except for it showing the extension.
Don't use that. Use your own extension. Otherwise it won't be
associated with your application, which means your application won't
be used to open these documents when the user double-clicks them, nor
will it display your document icon in the Finder.
Therefore how do
I register my new file extension to the OS
Look at what TextEdit does for RTFD documents.
and will it hide it for
me? How do I choose my new file extension so it doesn't clash
with others that might be out there?
If you're willing to use a reasonable number of characters it's not
that hard. Mac OS X allows as many as you want, so if you come up
with one that's reasonably unique with 8, 10, or more characters, the
chances of a conflict are remote.
If neither of these solutions can be solved, I will have to create
a new file format which contains the files needed for the document.
I've never needed to solve a solution before. ;-)
Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden