comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Search IDL content with Spotlight (Mac OS X)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Search IDL content with Spotlight (Mac OS X) [message #45396 is a reply to message #45300] Wed, 31 August 2005 16:02 Go to previous messageGo to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
jm@dmu.ac.uk <jm@dmu.ac.uk> wrote:
> So, it would seem that we need some way to force Spotlight to seek out
> *.pro files, but I can't see any way of doing that.

It's a bit more complicated than one might want, but it can be done.
Spotlight (and Tiger in general) internally use a system called
Universal Type Identifiers (UTIs) for handling file types.
See John Siracusa's sprawling technical review of Tiger for more details:
http://arstechnica.com/reviews/os/macosx-10.4.ars

The simplest way to make Spotlight index an arbitrary text file is to hack
on the Apple-provided RichText.mdimporter (in /System/Library/Spotlight/)
There's a decent discussion of how to do this at
http://www.macosxhints.com/article.php?story=200505141825207 14
You can change which file types the importer will look at by editing
/System/Library/Spotlight/RichText.mdimporter/Contents/Info. plist

For file types with defined UTIs, it's as simple as adding that UTI
to the appropriate part of the plist file. For IDL .pro files it's a
little harder, since there isn't a well defined UTI. But it's not too hard
to define UTIs; it just requires yet more addition of appropriately-crafted
text into the same plist file. A description of how to do this is available
with Apple's Spotlight developer docs, but I'll save you the trouble, since
I had to figure it out a while ago for a different project (Spotlight
indexing of astronomical FITS files).

I've put a modified version of RichText's Info.plist file online at
http://astron.berkeley.edu/~mperrin/software/Info.plist
If you download that and replace the one inside RichText.mdimporter with that,
Spotlight will start indexing .pro files for you.
Files will be indexed whenever they are saved or modified, or you can
manually import them with the "mdimport" command.

Give it a shot and let me know if you have any problems. I've just tested
it out on my own computer, but I don't think there are any bugs
(famous last words, yes. :-)

- Marshall
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Kernels et al
Next Topic: How to execute SQL query on IDL virtual machine without IDL DataMiner

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:43:59 PDT 2025

Total time taken to generate the page: 2.16034 seconds