[OS X TeX] Spotlight plug in

Bruno Voisin bvoisin at mac.com
Tue Jul 10 17:48:59 CEST 2007

Le 10 juil. 07 à 16:06, George Gratzer a écrit :

> I seem to have lost the plug in that caused Spotlight to  
> search .tex files.
> Could somebody remind me where to get it and how to install it?
> GG
> P.S. And how on earth did it disappear? G.

Generally the plugin lives within the TeXShop application, at / 

Some help regarding Spotlight may be provided by the related command- 
line utilities within Tiger (mdimport, mdutil and so forth). In  
particular, you get the list of all installed importers using  
"mdimport -L":

theo9mc182:~ bvoisin$ mdimport -L
2007-07-10 17:19:54.026 mdimport[679] Paths: id(501) (
     "/Library/Spotlight/Wolfram Notebook.mdimporter",
     "/Library/Spotlight/Microsoft Office.mdimporter",
     "/Library/Spotlight/Microsoft Entourage.mdimporter",
     "/Applications/Linotype FontExplorer X.app/Contents/Library/ 

Other instructions you might want to use:

- "mdutil -E <volume-name>" for rebuilding the Spotlight database for  
the indicated volume.

- "mdimport -f /usr/local/texlive" or "mdimport -f /usr/local/gwTeX"  
for forcing Spotlight to index the normally ignored TeX distributions  
within /usr/local.

You may even be more specific, and use the -r flag of mdimport, to  
specify which importer to use, as in:

mdimport -r /Applications/TeX/TeXShop.app/Contents/Library/Spotlight/ 
mdimport -r /Applications/TeX/BibDesk.app/Contents/Library/Spotlight/ 

It's possible that, in order for Spotlight to become aware of a  
importer stored within an application, you have to launch this  
application for the first time. For example, in case you just  
installed a new version of TeXShop but have not yet opened it, it's  
possible Spotlight is not yet aware of the plugin that it contains.

Something you won't be willing to do: try

mdimport -f -d3 /usr/local/texlive/2007/texmf-dist/tex/plain/base/ 

in order to see what Spotlight think is relevant in plain.tex  
(beware: long output in Terminal). If everything is properly  
configured, the output should contain:

     kMDItemContentType = "org.tug.tex";
     kMDItemContentTypeTree = ("org.tug.tex", "public.text",  
"public.data", "public.item", "public.content");
     kMDItemDisplayName = {"" = "plain.tex"; };
     kMDItemKind = {
         "" = "TeX Document";
         de = "TeX Dokument";
         es = "Documento TeX";
         fr = "Document TeX";
2007-07-10 17:44:13.417 mdimport[715] Import '/usr/local/texlive/2007/ 
texmf-dist/tex/plain/base/plain.tex' type 'org.tug.tex' using 'file:// 

That said, Herb Schulz has several times reported using a GUI  
interface to Spotlight called SpotlightIndexer <http:// 
www.kelleycomputing.net:16080/spotlightindexer/>. I'm not using it,  
but I would guess all the above is probably available much more  
easily within that GUI.

Hope this helps,

Bruno Voisin
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/

More information about the macostex-archives mailing list