[comp.sys.mac.hypercard] Getting text into a script

serre@boulder.Colorado.EDU (SERRE GLENN) (10/29/90)

Greetings,
I just thought this was an appropriate point to offer y'all the method I use
to get text from a field into my script so I can use it.  I have the user
( which is usually me) hold down the command key and click on the word that
he would like to act on.  This action
1) puts the word into the message box
2) shows the message box (BTW is there a way I can turn this off so I don't 
have to hide it later?)
3) Sends mouseUp to the field.  

Note that this method works in HC 1.2.x and HC 2.0.  It works for text in a
locked field (in HC 2.0, at least).  It doesn't get all of a group of text
(it only gets one word).  

Now for some questions:
1) Is there any way I can use this method to select grouped text (not just the
one word)?
2) A repeat:  How do I disable the message box before I command-click?

Thanks in advance, please email (summaries of responses to my earlier posts
will be posted after a suitable waiting period). 

Have a nice day :-)

--Glenn Serre
serre@tramp.colorado.edu

ollef@sics.se (Olle Furberg) (10/29/90)

>Note that this method works in HC 1.2.x and HC 2.0.  It works for text in a
>locked field (in HC 2.0, at least).  It doesn't get all of a group of text
>(it only gets one word).
 
  I don't understand why you fool around with this sort of scripts when you
use HC 2.0. What's wrong with the built-in clickText, clickChunk and clickLine
functions?

serre@boulder.Colorado.EDU (SERRE GLENN) (10/30/90)

In article <1990Oct29.143215.10128@sics.se> ollef@sics.se (Olle Furberg) writes:
>  I don't understand why you fool around with this sort of scripts when you
>use HC 2.0. What's wrong with the built-in clickText, clickChunk and clickLine
>functions?

Nothing, except that
1) For non-locked fields one needs a way to start the script. Using
command-click is an easy way (for me) to send a mouseUp to the field (It's 
faster than those mouseWithin handlers).  
2) I have only had HC 2.0 for 1 week (this is an excuse for item 3 below).
3) I was too stupid to try to get the clickText after I had the mouseUp.  

Thanks!  I now send mouseUp with the command-click and then get the 
clickedText.   


--Glenn Serre
serre@tramp.colorado.edu

taylorj@yvax.byu.edu (10/30/90)

Looks like you solved both your problems by using clickText and friends, but
if you still want to know how to keep the message box from popping up, read on...

set the loc of msg to -1000,-1000

If you do this, it would be prudent to save the original loc of the message box
first and then put it back when you're done.  Of course, this may not work a
few years from now when we have 2000x2000 pixel screens and the HyperCard
window is down in the corner.

Jim Taylor
Microcomputer Support for Curriculum  |
Brigham Young University              |  Bitnet: taylorj@byuvax.bitnet
101 HRCB, Provo, UT  84602            |  Internet: taylorj@yvax.byu.edu