How to paste into multiple fields

Ken Ray kray at sonsothunder.com
Thu Apr 10 01:31:33 EDT 2008


On 4/10/08 12:01 AM, "Bill Vlahos" <bvlahos at mac.com> wrote:

> Lets say I have three fields. Lets call then "FirstName", "LastName",
> and "Phone number".
> 
> I have information from another program copied to the clipboard in the
> form "Bill <tab> Vlahos <tab> 555-1212" that I want to be able to
> paste into the first field and have the text correctly flow into the
> other fields.
> 
> If I type it manually it works as the TAB key moves the selection to
> the next field. However, if I paste into the first field all of the
> text goes into that field.

How about instead of pasting, do:

  focus fld "FirstName"  -- plants insertion point
  type the clipboardData["text"]

It's a little slow, but it works...

Otherwise you'd have to parse the clipboard:

  put the clipboardData["text"] into tData
  set the itemDel to tab
  put item 1 of tData into fld "FirstName"
  put item 2 of tData into fld "LastName"
  put item 3 of tData into fld "Phone"

HTH,

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





More information about the use-livecode mailing list