[OS X TeX] TeXShop typesetting and macro questions

Claus Gerhardt gerhardt at math.uni-heidelberg.de
Tue Oct 3 15:22:53 EDT 2006


Below is a script that creates the -draft file and typesets it. It  
can be easily modified to open the draft's pdf file or to run  
pdflatex twice.

Claus


tell application "TeXShop"
	get path of document of window 1
	set fileName to result
end tell
set scriptPath to (do shell script "dirname " & "~/Library/Flashmode/ 
Subroutines/ex")
set scriptPath to scriptPath & "/setnametsn.scpt"
set scriptName to POSIX file scriptPath as alias
set scriptLiB to (load script scriptName)
tell scriptLiB
	set {baseName, texName, pdfName, namePath, dirName, dirNameunquoted,  
logName, logPath, rtfName, docName} to setnametsn(fileName)
end tell
set saveName to baseName & "-draft.tex"

set shellScript to "cd " & dirName & ";"
set shellScript to shellScript & "cat  " & docName & " " & ">" & " "  
& saveName
do shell script shellScript

set shellScript to "cd " & dirName & ";"
set shellScript to shellScript & "~/Library/Flashmode/bin/pdflatexc   
" & saveName
do shell script shellScript

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