How to copy-paste text from one field to another, changing Font and Size
Andre.Bisseret at inria.fr
Fri Aug 24 07:16:41 CDT 2007
I have a stack 1, including a field (field1) with lines of text.
The textFont of this field is « verdana »
The textSize of this field is « 10 »
and a stack 2 including an empty field (field2)
The textFont of this field is « Times »
The textSize of this field is « 12 »
I want to copy such line of field 1 in order to paste it in field 2
If I proceed manually (using the Edit menu or ctrl C and ctrl V) all
is running as expected :
the copied line of field 1 (in Verdana 10) is paste in Times 12 in
But when scripting, if, in stack 1, I
- put such line of field 1 in lVar
- set the clipBoardData[« text »] to lVar
- go to stack 2
- click a button whose mouseUp’ script is « paste »
then, the text is pasted in Verdana (it keeps the font of field 1) :-((
and more surprising, the textSize is 12 (the textSize expected, those
of field 2).
What am I doing wrong ?
By the way, is it possible to change Font, size, style etc. of text
in the clipBoard ?
Thanks a lot for any help
Best regards from Grenoble
More information about the use-livecode