[OS X TeX] Re: Flashmode-Alpha Trial version

Joachim Kock jkock at start.no
Thu Jan 6 06:26:40 EST 2005

> Knowing another tcl command would be helpful. It doesn't affect 
> Flashmode itself but one the accompanying scripts: finding and removing 
> a string in the front window, in short writing
> find "string"
> replace by ""

Assuming that the string is a literal string (not a regexp), the AlphaTcl
command would be

    eval replaceText [search -r 0 -- $findPat [minPos]] {""}

where $findPat is the string you want to delete.  

(The -r 0 flag means literal string, not regexp.  (The command minPos
returns the numerical value of the start position of the document.  This is
always 0 in AlphaX, but it is 1.0 in AlphaTk, because it uses the Tk text
rendering engine.  By using minPos instead of 0, you make sure the script
will work cross platform.)  If no match is found an error is raised.  The
-- means 'end of options' for search, and is only needed if the $findPat
starts with a hyphen.  I know that -- means something else in AppleScript
so if there is any trouble with that, and if you know that the search
string does not start with - then you can omit --.  (The eval command has
the effect of 'unpacking' the list returned by search into two arguments,
as required by replaceText, and the empty string "" is protected by {} in
order not to be evaluated.))


Få din egen @start.no-adresse gratis på http://www.start.no/
--------------------- 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 MacOSX-TeX mailing list