On Aug 30, 2005, at 11:05 AM, Andreas Busch wrote:
I installed it and tried it, but, alas, it doesn't seem to work,
not even after logging out and logging in again.
The way I tested it was to think of a word that so far was not on
my harddisk, type it into a new LyX document, and save that. Using
Spotlight afterwards should have produced a pointer to that file,
but did not. When I exported the file in question as ASCII,
Spotlight immediately found the word in that file.
Yes -- gibberish works well here!
Any suggestions on where I might have gone wrong? Here is the
output of the mdimport command (in case that is of any help, but it
looks normal to me):
nsdhcp209:~ > mdimport -r /Applications/LyX.app/Contents/Library/
Spotlight/LyX-Metadata.mdimporter/
2005-08-30 16:01:53.437 mdimport[4291] Asking server to reimport
files with UTIs: ("dyn.ah62d4rv4gk8y8xc3pa", "org.lyx.lyx",
"dyn.ah62d4rv4ge8028p2")
nsdhcp209:~ >
This should do it for old files, though it takes Spotlight a while to
complete the indexing. (Did you wait for that to happen?)
Apparently this alone doesn't work for new files you create; that's
why I tell you to log out and then back in: that fixes it for me.
By the way, the Spotlight looking glass symbol in the upper right
hand corner of the screen did not indicate that Spotlight was
indexing anything -- I don't know whether it is supposed to, but
you seemed to hint at it.
(It doesn't.)
The normal course of things is to have the metadata importer already
a part of the application bundle. Thus, when you initially copy a new
application to your hard drive, Spotlight looks to see if there's an
importer there, and if so it uses it. (Macs also look at info.plist
files to get information about what file extensions to associate with
applications, etc.) Spotlight will also monitor ~/Library/Spotlight, /
Library/Spotlight, and /System/Library/Spotlight to see if you add
new importers in those locations, and these will be automatically
used. (That's what happened for you when you put the importer in /
System/Library/Spotlight.) However, I don't recommend putting it
there: in the future when LyX/Mac is updated, the Spotlight importer
might be updated as well; when that happens, the new Spotlight
importer will be inside the LyX.app bundle. If you have another
metadata importer in another location telling Spotlight how to index
the same type of files, Spotlight will get confused. That's why I
recommend installing directly inside the LyX.app bundle: for future
compatibility.
However, mucking about inside application bundles and directly
installing metadata importers is not something Spotlight expects
users to be doing. That's what requires the strange installation
procedure I've outlined on the wiki.
So: if the procedure I've outlined doesn't work for you, will it work
if you restart instead of logging out and back in? (To test this,
remove the LyX-Metadata.mdimporter file from /System/Library/
Spotlight, put it in LyX.app/Library/Spotlight, and run the mdimport
command from Terminal. Then wait a little while (10 minutes will
likely do it) for the indexing to complete, and restart. Does that work?
Bennett