Re: Spotlight, Content Indexing, and SearchKit integration questions
Re: Spotlight, Content Indexing, and SearchKit integration questions
- Subject: Re: Spotlight, Content Indexing, and SearchKit integration questions
- From: robert delius royar <email@hidden>
- Date: Thu, 2 Jun 2005 11:15:41 -0400 (EDT)
- Organization: Hobbyist and OS X User
- Priority: normal
Thu, 2 Jun 2005 (09:12 -0500 UTC) Dr. Smoke wrote:
2. How kDMItemContent is populated if one has files whose UTIs match the
types supported by the existing mdimporter objects.
Many caveats apply to this response, the primary one being "I do not
understand what I am doing."
However, I have managed to write two MDImporters that allow Spotlight and
the searchkit to find text in files created by two programs that were not
indexing text (Pine and XEmacs). The text is plain ASCII. I found the help
I needed by contacting the author of the unix man file importer (on Apple's
site) who sent me a copy of the source to the objC file.
It is just a minor adjustment to Apple's importer example. Here are the
lines that were different:
File=[[NSData alloc] initWithContentsOfFile:(NSString *)pathToFile];
if (File)
{
NSString *FileContent=[[NSString alloc] initWithData:File encoding:NSASCIIStringEncoding];
[(NSMutableDictionary *)attributes setObject:FileContent forKey:(NSString *)kMDItemTextContent];
...
}
The StringEncoding was the part I was not getting. I do not know if this
will help you, but it seems that someone who knows what s/he is doing could
go much further than I with this start.
I would like to see an example that could be hooked into a terminal-based
program's fopen() or fcreate() call that would tell the OS "this newly
created file has a kMDItemContentType of MY.UNIQUE.REVERSE.DNS.ID."
Currently, the programs rely on the file extent.
--
Dr. Robert Delius Royar Associate Professor of English
Morehead State University Morehead, Kentucky
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden