[OS X TeX] Spotlight plug in

Bruno Voisin bvoisin at mac.com
Tue Jul 10 11:48:59 EDT 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 / 
Applications/TeX/TeXShop.app/Contents/Library/Spotlight/TeX.mdimporter.

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) (
     "/System/Library/Spotlight/Image.mdimporter",
     "/Library/Spotlight/Wolfram Notebook.mdimporter",
     "/Library/Spotlight/Microsoft Office.mdimporter",
     "/Users/bvoisin/Library/Spotlight/FontMDI.mdimporter",
     "/Library/Spotlight/Microsoft Entourage.mdimporter",
     "/Library/Spotlight/SourceCode.mdimporter",
     "/System/Library/Spotlight/Bookmarks.mdimporter",
     "/Applications/NeoOffice.app/Contents/Library/Spotlight/ 
neolight.mdimporter",
     "/System/Library/Spotlight/QuickTime.mdimporter",
     "/System/Library/Spotlight/vCard.mdimporter",
     "/Library/Spotlight/AppleWorks.mdimporter",
     "/System/Library/Spotlight/PDF.mdimporter",
     "/Library/Spotlight/Keynote.mdimporter",
     "/System/Library/Spotlight/RichText.mdimporter",
     "/Applications/TeX/TeXShop.app/Contents/Library/Spotlight/ 
TeX.mdimporter",
     "/Library/Spotlight/iWeb.mdimporter",
     "/Applications/OmniOutliner.app/Contents/Library/Spotlight/ 
OmniOutlinerMetadataImporter.mdimporter",
     "/Library/Spotlight/Pages.mdimporter",
     "/System/Library/Spotlight/PS.mdimporter",
     "/System/Library/Spotlight/Audio.mdimporter",
     "/Applications/TeX/BibDesk.app/Contents/Library/Spotlight/ 
BibImporter.mdimporter",
     "/System/Library/Spotlight/iCal.mdimporter",
     "/Library/Spotlight/iMovie.mdimporter",
     "/System/Library/Spotlight/Mail.mdimporter",
     "/System/Library/Spotlight/Application.mdimporter",
     "/System/Library/Spotlight/SystemPrefs.mdimporter",
     "/Applications/Linotype FontExplorer X.app/Contents/Library/ 
Spotlight/FontExplorerXMDI.mdimporter",
     "/System/Library/Spotlight/iPhoto.mdimporter",
     "/System/Library/Spotlight/QuartzComposer.mdimporter",
     "/System/Library/Spotlight/Chat.mdimporter"
)

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/ 
TeX.mdimporter
mdimport -r /Applications/TeX/BibDesk.app/Contents/Library/Spotlight/ 
BibImporter.mdimporter

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/ 
plain.tex

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:// 
localhost/Applications/TeX/TeXShop.app/Contents/Library/Spotlight/ 
TeX.mdimporter/'

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 MacOSX-TeX mailing list