[OS X TeX] Collaborative editing using SubEthaEdit?
Claus Gerhardt
gerhardt at math.uni-heidelberg.de
Wed Sep 20 13:14:15 EDT 2006
The Aplescript below will do what you want.
Claus
--AppleScript
-- Apply only to an already saved file
-- Claus Gerhardt, September 2006
(*This script refreshes the front text document in TeXShop*)
tell application "TeXShop"
get path of document of window 1
set fileName to result
end tell
set {baseName, texName, pdfName, namePath, dirName, dirNameunquoted,
logName, logPath, rtfName, docName} to setnametsn(fileName)
tell document docName of application "TeXShop"
refreshtext
end tell
on setnametsn(x)
set n to (number of characters of contents of x)
set fileNamequoted to quoted form of x
set windowName to do shell script "basename " & fileNamequoted
set m to (number of characters of contents of windowName)
set dirName to quoted form of (characters 1 thru (n - m - 1) of x as
string)
set dirNameunquoted to (characters 1 thru (n - m - 1) of x as string)
set theText to contents of windowName as string
set n to (number of characters of contents of theText)
set i to n as number
repeat while i > 0
if character i of theText is equal to "." then
set m to i
exit repeat
else
set i to (i - 1)
end if
end repeat
set baseName to (characters 1 thru (m - 1) of theText as string)
set texName to baseName & ".tex"
set namePath to dirNameunquoted & "/" & baseName as string
set pdfName to namePath & ".pdf" as string
set rtfName to namePath & ".rtf" as string
set logPath to namePath & ".log" as string
set logName to baseName & ".log" as string
set theFile to POSIX file x as string
tell application "Finder"
get displayed name of the file theFile
end tell
set docName to result
return {baseName, texName, pdfName, namePath, dirName,
dirNameunquoted, logName, logPath, rtfName, docName} as list
end setnametsn
On Sep 20, 2006, at 18:41, Markus wrote:
> Hi,
>
> does anybody know how to use the collaborative editing features of
> SubEthaEdit with latex in a smart way? Right now, I would do all
> the editing in SubEthaEdit and then, when I wanted to compile it,
> open the .tex file in TeXShop, compile it, close the .tex file in
> TeXShop and do any changes in SubEthaEdit, then open it in TeXShop
> again.... and so on.
>
> If TeXShop had a refresh feature like e.g. Textwrangler I would not
> have to open and close the file constantly.
>
> Cheers,
>
> Markus
>
>
> ------------------------- 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 MacOSX-TeX
mailing list