How do I trap the "text insertion point"?

Ken Ray kray at sonsothunder.com
Wed Oct 23 21:22:01 CDT 2002


Alan,

How about:

1) set the traversalOn of the button to false -- so it doesn't take the
focus away from the field

2) have the button say either:

-- "field 1" is your field and "the myProp of this card" is your custom
property

on mouseUp
  if the selectedChunk of field 1 is not empty then
    type (the myProp of this card)
  end if
end mouseUp

This has the effect of "typing" the text so you see it show up one character
at a time. If this is too slow, you can do:

on mouseUp
  if the selectedChunk of field 1 is not empty then
    put (the myProp of this card) before char (word 2 of the selectedChunk)
of field 1
  end if
end mouseUp

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



----- Original Message -----
From: "Alan Gayne" <alanIra9 at mac.com>
To: <use-revolution at lists.runrev.com>
Sent: Wednesday, October 23, 2002 6:17 PM
Subject: How do I trap the "text insertion point"?


> Hi all!
>
> I've been trying to emulate the Quickeys "Type Text" function - i.e. to
> be able to click on a button and have the text that has been stored as a
> custom property inserted at that place in a field where the text
> insertion iBeam is located.  The only problem with this is that I can't
> seem to find a way to find out the location of the iBeam so I cn tell
> rev to put my text there.
>
> I would suspect that the iBeam insertion point is a system property
> since Quickeys is able to insert text into any open application with an
> editable field and such a basic property must be readily available to
> every open application, including the RunRev script editor.
> Nevertheless, after spending hours looking through the transcript
> dictionary (for which a simple index would be REALLY helpful) I can't
> seem to locate any function that either reports this property and
> converts it to a location usable by RunRev.
>
> It seems like this has GOT to be something simple but I'll be darned if
> I can find it.
>
> Any help would be greatly appreciated.
>
> Thanks in advance.
>
> Alan
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list