[OS X TeX] Configure TeXshop to use ``ANT''?

Claus Gerhardt gerhardt at math.uni-heidelberg.de
Fri Oct 13 00:56:51 CEST 2006


Sorry, the check if the file exists is nonsense in this case. Here is  
a new script.

Claus

-- Applescript
-- Claus Gerhardt

(*The script creates a basename.ant file when a  basename.tex file is  
open in TS and runs the shell script ant which is supposed to be in ~/ 
Library/Flashmode/bin/ant, and opens the pdf file.  Needs Flashmode- 
downloadable.*)


--on ant()
tell application "TeXShop"
	get path of document of window 1
	set fileName to result
	--set saveName to the content of the selection of the front document
	--set saveName to saveName & ".tex"
end tell
set previewer to "TeXShop"


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 antName to baseName & ".ant"
set fileName1 to dirNameunquoted & "/" & antName
set theFile to POSIX file fileName1
set theLine to 1 as number


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

try
	set shellScript to "cd " & dirName & ";"
	set shellScript to shellScript & "~/Library/Flashmode/bin/ant  " &  
antName
	do shell script shellScript
	
	set thePDF to POSIX file pdfName as alias
	set scriptPath to (do shell script "dirname " & "~/Library/Flashmode/ 
Subroutines/ex")
	set scriptPath to scriptPath & "/preview_bbedit.scpt"
	set scriptName to POSIX file scriptPath as alias
	set scriptLiB to (load script scriptName)
	tell scriptLiB
		preview_bbedit(docName, thePDF, previewer, process_name)
	end tell
	
on error
	set logFile to logPath as POSIX file
	tell application "TeXShop"
		activate
		open logFile
	end tell
end try


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