[OS X TeX] Leo's Spotlight doesn't find sty, lco, engine files

Maarten Sneep maarten.sneep at xs4all.nl
Sun Nov 18 23:11:42 CET 2007


On 18-nov-2007, at 22:32, Friedrich Vosberg wrote:

> Am 18.11.2007 um 16.34 schrieb Maarten Sneep:
>>
>> What is it that you would want to find in sty and lco files that  
>> make it worthwhile to add them to the spotlight index?
>
> I want to find the files itself. When I want to open the file  
> xyzname.sty and did not know, where the file is, in Tiger I could  
> hit Cmd+Space, enter xyzname, and the Spotlight search has found it  
> immediately. The Leo Spotlight doesn't find it. That's the issue.

Ah, due to a defective optical drive I'm still on Tiger. Will get  
that sorted soon though.

Here is a little AppleScript that should get you going. It is  
unforgingin for typos though.:

on run
	set mydialog to display dialog "Give the name of the TeX file you  
are looking for" default answer "" buttons {"Show", "Cancel"} default  
button "Show" cancel button "Cancel" with title "Search for TeX file"
	if button returned of mydialog is "Show" and ((text returned of  
mydialog) as string) is not "" then
		set cmd to "PATH='/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ 
texbin' ; kpsewhich \"" & ((text returned of mydialog) as string) & "\""
		set myPOSIXfiles to do shell script cmd
		if myPOSIXfiles as string is not "" then
			set myfiles to ((myPOSIXfiles as POSIX file) as alias)
			tell application "Finder"
				open container of myfiles
				activate
			end tell
		end if
	end if
end run



More information about the macostex-archives mailing list