[OS X TeX] kpsewhich-open

Claus Gerhardt gerhardt at math.uni-heidelberg.de
Sun Dec 17 23:05:39 CET 2006


Below is an Applescript to open a document, found by kpsewhich, in an  
editor of your choice; presently it is TeXShop. Save it as a macro. A  
local symlink ~/texprograms to the tex source is required.

Claus

-- Applescript
-- Claus Gerhardt
-- December 2006



set dialogSelection to "Enter the name of the file you are looking  
for, e.g., index.sty or babel.def"
activate

set input to the text returned of (display dialog dialogSelection  
default answer "" buttons {"Cancel", "Ok"} default button "Ok")


	set theApplication to "TeXShop"
	
	set shellScript to "$HOME/texprograms" & "/kpsewhich " & input
	do shell script shellScript
	set output to result
	
	set theFile to POSIX file output
	
	tell application theApplication
		activate
		open theFile
	end tell


------------------------- 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