[OS X TeX] latexdb & texshop

Ingo Reich ireich at mac.com
Wed Oct 12 19:12:51 EDT 2005

I'd like to use latexdb from within texshop. (latexdb is a script  
based on python that enables one to connect to mySQL-databases from  
within a latex-file: http://privat.hgesser.com/software/latexdb/). I  
tried to adapt one of Claus Gerhardts Scripts and came up with the  
one below. The applescript works properly the first time it is  
called, the second time ii is called however texshop complains that  
it can't locate the file example.tex  (in German: "Der Ort des  
Dokuments 'example.tex' konnte nicht festgestellt werden"), and it  
wants me to "save as ...". Any ideas what's going wrong here? Thanks,

%%%%%%%% begin %%%%%%%

set scriptPath to (do shell script "dirname " & "~/Library/TeXShop/ 
set scriptPath to scriptPath & "/setname.scpt"
set scriptName to POSIX file scriptPath as alias
set scriptLiB to (load script scriptName)
tell scriptLib
set frontName to setname(#NAMEPATH#,#TEXPATH#)
end tell

set fileName to  #NAMEPATH#
set n to (number of characters of contents of fileName)
set fileNamequoted to quoted form of fileName
set baseName to do shell script "basename " & fileNamequoted
set m to (number of characters of contents of baseName)
set dirName to quoted form of (characters 1 thru (n - m - 1) of  
fileName as string)
set texName to baseName & ".tex"

set shellScript to "cd " & dirName & ";"
set shellScript to shellScript & "~/Library/TeXShop/bin/latexdbi  " &  
do shell script shellScript

tell application "TeXShop"
   open POSIX file #DVIPATH#
end tell
%%%%%%%%% end %%%%%%%%%%

where "latexdbi" is the following binary script:

%%%%%%%% begin %%%%%%%%%%
# latexdbi

set path= ($path  /usr/local/bin  /usr/local/teTeX/bin/powerpc-apple- 

latexdb  "$1.tex"

%%%%%%%%% end %%%%%%%%%%

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the MacOSX-TeX mailing list