Diary of a Mac Virgin

Basically the idea is to document my experience of getting used to a MacBook with OS X Tiger and familiarise myself with Blogger at the same time. That's right, I've never blogged before either.

Friday, November 24, 2006

Spotlight - bright-ish... perhaps?

The blurb about Tiger makes out like Spotlight is the best thing since sliced bread but my investegatory clicks on the little magnifying glass icon up there on the menu bar left me wondering why? It seemed to offer little more than a way of finding things whose locations I should already know if I'd stored them in a sensible place.

I was a little less dismissive after the first occasion on which I found myself wondering "where the heck did I put that letter to the Inland Revenue?". Spotlight found it for me in a trice along with a couple of older letters, a spreadsheet and a .pdf that mention them. By the third occasion on which it had located something that had "slipped down the back of my digital sofa" I had warmed to it quite a bit. It looks more interesting when accessed via the Find option on Finder's file menu as this allows you to specify a number of criteria on which to search.

A big disappointed however was the realisation that Spotlight was not indexing my .php files. Back on the PC (which has now been retired) I sometimes used my programers editor (EditPlus) to search all the files in a given directory (subdirectories too if I wanted it to) to find files where a particular function was employed. Smultron, my editor of choice here on the Mac does not have this facility and sooner or later, I'm going to need it.

My 'Rough Guide' book told me that plug-ins to allow Spotlight to index the files from various additional applications are available on Apple's site, but although there are plug-ins for a number of file types, I found no mention of anything to handle .php files.

A little searching on the web came up with suggestions for modifying the info.plist of the RichText.mdimporter or the SourceCode.mdimporter (installed with the Developer Tools) to deal with php files. I also stumbled accross a suggestion that messing with these without a proper understanding of them was perhaps not a good idea. While I'm inclined to agree with the latter I figured that if this was such a bad idea then hopefully there would be fewer suggestions on the web that it is a solution - a million lemmings can't be wrong, can they?

I didn't get as far as trying it however because many of these suggestions also said that the last step was to tell Spotlight to reindex the files and that this could "take a while". There was something about that suggestion that bothered me so I did a little more searching and came across all kinds of complaining about Spotlight doing an incomplete job. I haven't really gotten to the bottom of it but: Spotlight doesn't search for things when you ask it to search; instead it indexes stuff 'Google style', in the background, ready for when you do want to find something. It appears however that while some actions will cause a file to be indexed, others do not. I've seen it suggested for example that although saving a file causes it to be indexed, copying a file does not - so the copied file will not show in a search. I also get the impression that depending on what else is happening on the computer it could take a while even for a newly edited and saved file to be re-indexed.

It would appear therefore, that while Spotlight can be very useful for finding things, you can't RELY on it to find ALL occurrences. A bit like Google: it might find what you want, and frequently does, but there are no guarantees. Thus I will continue to use it when the question that needs answering is "where did I put x?", however it appears that it is not the thing to use if I want to "find every one of my .php files that makes use of function x so that I don't screw anything up if I change it". I guess I'll have to find something else for that.

0 Comments:

Post a Comment

<< Home