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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Search IDL content with Spotlight (Mac OS X) [message #45298] Wed, 31 August 2005 15:00 Go to next message
jm is currently offline  jm
Messages: 32
Registered: April 2003
Member
> I think that IDL indexes

Duh! Silly typo. I mean, of course that *Spotlight* indexes...
Re: Search IDL content with Spotlight (Mac OS X) [message #45300 is a reply to message #45298] Wed, 31 August 2005 13:37 Go to previous messageGo to next message
jm is currently offline  jm
Messages: 32
Registered: April 2003
Member
I think that IDL indexes files primarily by type, or at least filename.
I tried the following:

ln -s foo.pro foo.txt

No effect - Spotlight doesn't pick-up on the file contents. However,

cp foo.pro foo.txt

results in a file (foo.txt) that Spotlight has indexed (instantly).
Evidently, the recognition that Spotlight uses in this instance is
based entirely on the file name. What's more, it's needs to be a copy
rather than a link (even if the soft-link worked, that would hardly be
an elegant solution).

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.

-John Mardaljevic
Re: Search IDL content with Spotlight (Mac OS X) [message #45301 is a reply to message #45300] Wed, 31 August 2005 09:11 Go to previous messageGo to next message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <1125478758.478542.112220@o13g2000cwo.googlegroups.com>,
jm@dmu.ac.uk wrote:

> Has anyone figured out how to search IDL content using Spotlight? I
> suspect this is non-trivial.
>
> -John Mardaljevic

Check out this Apple help file

http://docs.info.apple.com/article.html?artnum=301533

I made an alias of /usr/local/rsi/idl_6.1/help in my home directory and renamed
it IDL Docs (so I could remember what it was). As best I can tell, Spotlight
indexed that directory.

You may need to turn on "Index PDF files" in the Spotlight preferences pane.

Ken Bowman
Re: Search IDL content with Spotlight (Mac OS X) [message #45303 is a reply to message #45301] Wed, 31 August 2005 06:47 Go to previous messageGo to next message
Ken Mankoff is currently offline  Ken Mankoff
Messages: 158
Registered: February 2000
Senior Member
On Wed, 31 Aug 2005 jm@dmu.ac.uk wrote:
> Has anyone figured out how to search IDL content using Spotlight?
> I suspect this is non-trivial.

Here is a hint on how to search Firefox bookmarks with Spotlight.
Probably a good starting point...

http://www.macosxhints.com/article.php?story=200508251658435 74&lsrc=osxh

-k.
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 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
Re: Search IDL content with Spotlight (Mac OS X) [message #45397 is a reply to message #45300] Wed, 31 August 2005 15:06 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <1125520674.079332.234490@g47g2000cwa.googlegroups.com>,
jm@dmu.ac.uk wrote:

> I think that IDL indexes files primarily by type, or at least filename.
> I tried the following:
>
> ln -s foo.pro foo.txt
>
> No effect - Spotlight doesn't pick-up on the file contents. However,
>
> cp foo.pro foo.txt
>
> results in a file (foo.txt) that Spotlight has indexed (instantly).
> Evidently, the recognition that Spotlight uses in this instance is
> based entirely on the file name. What's more, it's needs to be a copy
> rather than a link (even if the soft-link worked, that would hardly be
> an elegant solution).
>
> 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.
>
> -John Mardaljevic

Hmmm, I don't have any problem with Spotlight searching my .pro files. They are
all within my home directory.

Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 13:05:13 PDT 2025

Total time taken to generate the page: 0.00589 seconds