[OS X TeX] Defining the file name in the tex file
Claus Gerhardt
gerhardt at math.uni-heidelberg.de
Thu Sep 28 21:56:13 CEST 2006
The script below should do what you want. I may use it myself.
Claus
(*Have a template file with the correct suffix open in TS, then run
the script, aftter inserting the desired name for saveName. Needs
Flashmode-downloadable.*)
set saveName to "test-save.tex"
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 & "/setnamebbedit_rootn.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 setnamebbedit_rootn(fileName)
end tell
set fileName1 to dirNameunquoted & "/" & saveName
set theLine to 1 as number
set shellScript to "cd " & dirName & ";"
set shellScript to shellScript & "cat " & docName & " " & ">" & " "
& saveName
do shell script shellScript
do shell script "~/Library/Flashmode/bin/texshopcg " & theLine & " "
& fileName1
On Sep 28, 2006, at 18:34, Friedrich Vosberg wrote:
> Morning.
>
> Can I define the name of the file *inside* the tex file? In the
> Save dialogue window should not appear »New File« in the file name
> field but the given filename. Possible?
>
> TIA and kind regards. Friedrich
>
> --
> »I have never been certain that the moral of the Icarus myth is, as
> is generally accepted, 'don't fly too high', or whether it might
> also be thought of as: 'forget about the wax and feathers, and do a
> better job on the wings'.« (Stanley Kubrick)
>
>
>
> ------------------------- 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