Copying styled text

Richard Gaskin ambassador at fourthworld.com
Thu Jun 3 15:30:03 EDT 2004


Shari wrote:

> There is a background field with sharedText off, and each card has 
> different text in this field.  There is a lot of bold, colored, link, 
> and other styled text in this field, and I am trying to copy the fully 
> styled text from one stack to another (in rebuilding the corrupted stack).
> 
> I followed the instructions for doing this exactly as the Metacard 
> instructions advise, adding only the info needed to unlock the field.
> 
> on mouseUp
>   go stack "oldStack"
> repeat with x = 2 to the number of cds of stack "oldStack"
>     go cd x of stack "oldStack"
>     if there is a fld "Info" of cd x of stack "oldStack" then
>       set the traversalOn of fld "Info" of cd x of stack "oldStack" to true
>       set the lockText of fld "Info" of cd x of stack "oldStack" to false
>       set the autoHilite of fld "Info" of cd x of stack "oldStack" to true
>       set the sharedText of fld "Info" of cd x of stack "oldStack" to false
>       select text of fld "Info" of cd x of stack "oldStack"
>       copy
>      go cd x of stack "newPC"
>       set the traversalOn of fld "Info" of cd x of stack "newPC" to true
>       set the lockText of fld "Info" of cd x of stack "newPC" to false
>       set the autoHilite of fld "Info" of cd x of stack "newPC" to true
>       set the sharedText of fld "Info" of cd x of stack "newPC" to false
>       select text of fld "Info" of cd x of stack "newPC"
>       paste
>     end if
>   end repeat
>   save stack "newPC"
> end mouseUp
> 
> It does not work.  I get the following error immediately:
> 
> on mouseUp
>   editScript the long id of the errorobject of this card
> end mouseUp
> 
> If I try:
> 
> put fld "info" of cd x of stack "oldStack" into fld "info" of cd x of 
> stack "newPC"
> 
> The text copies over, but the formatting is lost, and there are 60 cards 
> that would require all of the text to be diddled with.
> 
> Help!
> 

you may find using the htmlText text will give you faster and mroe 
robust results:

   set the htmlTex of fld 1 to the the htmlText of fld 2

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com


More information about the metacard mailing list