On Feb 26, 2008, at 00:16, Gerriet M. Denkmann wrote:
I have an application (10.4.11) which creates simple text files
(utf-8 or utf-16).
When I store some document as "myNewFile" then Spotlight does know
nothing about it's content.
But when I store the same file as "myNewFile.txt" then all is fine.
Is there a way to tell Spotlight to treat all files with
NSFileHFSCreatorCode = 'MyAp' as if it had a ".txt" file extention?
Or: if NSFileHFSCreatorCode = 'MyAp' then treat it as public.plain-
text (unless the file extention says otherwise).
Your file is going to need a application-defined UTI, which is defined
in the app's info.plist file. That private UTI definition can also
equate your private HFS creator code to the private UTI, but there's
not much point in using that mechanism if you're saving the file with
a UTI anyway. I'm guessing that spotlight will happily index a file
with UTI public.plain-text.something-your-application-defined as a
text file, but I don't know for sure.