[OS X TeX] Applescript-tcl dictionary, wishlist

Jon Guyer jguyer at his.com
Thu Jan 6 19:54:41 CET 2005


On Jan 6, 2005, at 12:17 PM, Claus Gerhardt wrote:

> Let me suggest some commands that should be part of an Applescript-tcl 
> dictionary, especially having tex files in mind:
>
> - get line -- get the number of the line, where the insertion point is
> - goto line lineNumber of fileName (or of the front window)
> - find and replace all -- the option for *all* in the find replace 
> command
> - a detailed description of find and replace with grep
> - keystroke "string" -- type the string at the current insertion point
> - set theSelection to selection --selection means highlighted text

OK, I'll let you know when we have these implemented.

Joachim can provide interim DoScript solutions if he likes, although I 
think quoting is going to remain a problem, even if you don't permit 
foolish file names. Foolish file contents are much harder to ban. E.g.,

set findText to "$sin(x)$"
set replaceText to "$cos(x)$"

tell application "AlphaX"
	DoScript "eval replaceText " & "[search -r 0  " & findText & " " & 
"[minPos]]" & " " & "{" & replaceText & "}"
end tell

will complain:
	can't read "sin(x)": no such variable
or even
	can't read "sin(x)": no such element in array

--------------------- 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 Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list