<HTML>
<HEAD>
<TITLE>Re: Selecting a word</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<FONT SIZE="1"><FONT FACE="Mishawaka">>I am having a problem finding a command to select a word<BR>
>and put it into a container...<BR>
>I'd like to click on a word, show a rectangle around it (like in <BR>
>Hypercard) or color it, and put it into a variables container.<BR>
<BR>
<BR>
I'm not 100% sure if this is what you want, but the following works in a field's script for double-clicking on a word in an unlocked field to put the word in a container.  (For an unlocked field I assume you don't want to interfere with single-clicking.)<BR>
<BR>
on selectionChanged<BR>
  put the ticks into t<BR>
  repeat until the mouseClick<BR>
     if the ticks - t > the doubleClickInterval then exit to top --SEE NOTE BELOW<BR>
  end repeat<BR>
  if the clickChunk = "" then exit to top<BR>
  select the clickChunk --OPTIONAL, TO HILITE THE WORD<BR>
  put the clickText into someContainer<BR>
end selectionChanged<BR>
<BR>
(NOTE: "the doubleClickInterval" gives me a number apparently in milliseconds, though the documentation says it should be in ticks on a Mac.  Perhaps this is somehow due to my non-Mac (Logitech) mouse. If this is also the case for you, substitute literal value for a reasonable number of ticks, like 20.) <BR>
<BR>
If you have a mouse with a right button, the following also works to (right) single-click (for me anyway):<BR>
<BR>
on mouseUp<BR>
  select the clickChunk --OPTIONAL, TO HILITE THE WORD<BR>
  put the clickText into someContainer<BR>
end mouseUp<BR>
<BR>
This works without specifying a mouse button parameter because, for some reason, the mouseUp message evidently is only sent to the field if you right-click and not if you left click.<BR>
<BR>
If the field is locked and you just want to single-click in the normal way on the word, the above mouseUp handler works too.<BR>
<BR>
Hope this helps,<BR>
<BR>
Stuart Milliken<BR>
<BR>
</FONT></FONT>
</BODY>
</HTML>