[OS X TeX] latexdb & texshop

Claus Gerhardt gerhardt at math.uni-heidelberg.de
Thu Oct 13 02:30:37 CEST 2005


The command in the shell script should be

> latexdb  "$1"


Claus


On Oct 13, 2005, at 1:12, Ingo Reich wrote:

> Hi,
> 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,
> Ingo
>
>
>
> %%%%%%%% begin %%%%%%%
> --Applescript
>
> set scriptPath to (do shell script "dirname " & "~/Library/TeXShop/ 
> Scripts/ex")
> 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  "  
> & baseName
> do shell script shellScript
>
> tell application "TeXShop"
>   activate
>   open POSIX file #DVIPATH#
> end tell
> %%%%%%%%% end %%%%%%%%%%
>
>
> where "latexdbi" is the following binary script:
>
> %%%%%%%% begin %%%%%%%%%%
> #!/bin/tcsh
> # latexdbi
>
> set path= ($path  /usr/local/bin  /usr/local/teTeX/bin/powerpc- 
> apple-darwin-current)
>
> 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/
>
>

------------------------- 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 macostex-archives mailing list