At 4:17 PM -0700 4/29/2002, Heather Donahue wrote:
In MacOS 9 it's possible to filter opening documents by creator and
type. If I want my app to open a text document I can just filter by
Since it isn't necessary to have a type or creator in a MacOS X
document, how do you filter the Navigation browser?
I'm guessing the only thing to filter by is the extension, '.txt' or
'.text', but how do you do that from the Navigation browser?
Set a filterProc for your NavServices dialog. That's a
NavObjectFilterUPP, which will be called for each item as it gets
displayed in the dialog. From there you can get an FSRef and return
whether your dialog will accept that item.
In the case of a text file, you'd check the type of the FSRef, and if
it's TEXT, you'd accept it. If the type isn't TEXT, you'd check the
extension, and if that's '.txt' or '.text' (or perhaps .c, .h, etc.),
you'd accept it. You have to check both types and extensions, since
any given file may have one, the other, or both of those set (or
If I recall correctly, the NavServices 2.0 documentation includes an
example of a filter procedure.