Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using OSX 10.6 and want to have content searches in finder for the source code types i use. This suggests a (10.4 only?) solution, but although i have the developer tools installed i don't have /Library/Spotlight/SourceCode.mdimporter.

Is there a different procedure for Snow Leopard or did i miss something?

Edit:
This looks better, but how to register new file types which don't have UTIs yet?

Edit2:
To clarify - i am ok with a simple plain text search through these files...

share|improve this question
    
What types of text files are you using that aren't already being indexed? –  Hasaan Chop Mar 27 '10 at 20:20
    
Currently e.g. .cmake . –  gfr Mar 28 '10 at 0:03

3 Answers 3

So it seems your problem is not in getting Spotlight to add something as much as getting the OS to see that .cmake files are plain text.

From the first edit I'm guessing that mdimport -n -d1 somefile.cmake isn't returning anything useful (If it is just add that type).

If it's not, try mdimport -d1 *.cmake public.plain-text or something similar.

Since I don't have any cmake files I can't test this.

share|improve this answer
    
mdimport -n -d1 foo.cmake doesn't output anything. As for mdimport -d1 *.cmake public.plain-text - is there a better way to do this globally then say a recursive find -exec? Can't i add file extensions that should always be automatically indexed as plain text? –  gfr Mar 30 '10 at 19:49
    
I couldn't find one. As someone mentioned, you could write your own Spotlight plugin, but that seems like a lot of work. Personally, I would either put something in cron, or add an entry to your makefile to do it. –  Chris Apr 1 '10 at 16:13

It already works fine in 10.6 for common source code file types, e.g. .c, .h, etc.

share|improve this answer
    
And for those which aren't yet supported? –  gfr Mar 27 '10 at 21:12

You'll need to produce your own Spotlight plugin which defines a UTI for those files and hands them off as plain text. You can also try editing an existing importer, but since they're all code signed now, that may or may not break something important.

cmake is generally more trouble than it's worth.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.