[OS X TeX] Applescript-tcl dictionary, wishlist

Maarten Sneep maarten.sneep at xs4all.nl
Thu Jan 6 16:48:57 EST 2005


On 6 jan 2005, at 22:26, Claus Gerhardt wrote:

> These two commands (requests) are completely independent from each 
> other.

I think there is some confusion as to what you want: you want both 
insertion
of a string and a way to obtain the currently selected text. In BBEdit 
both
are performed on the selection. If nothing is selected, the selection 
amounts
to a string with a starting point and length zero.

Compare:
     set my_selection to selection
     (this sets a variable my_selection to the range of the currently 
selected text:
      "characters 2331 thru 2359 of text document 1")
to:
     set my_selection to selection as text
     (this finds the actual contents of the selection:
      "eet, enter the license owner ")

To type into a text file in BBEdit, one can use the following:
     set the selection to "Help, I'm a Rock!"
     (this replaces the selection with the text "Help, I'm a Rock!", 
regardless
      of the length of the current selection)

So the two features are related, it is just the direction that is 
different. I must
admit that I had to read the code Claus supplied twice to get that 
though.

Maarten

> On Jan 6, 2005, at 18:34, Stefan Walsen wrote:
>
>> Claus Gerhardt wrote:
>>> - keystroke "string" -- type the string at the current insertion 
>>> point
>>> - set theSelection to selection --selection means highlighted text
>>
>> these two are actually the same, aren't they?
>>
>> (not trying to be rude, just wondering if i am missing something)

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