Manipulating PLAIN text on the clipboard (trying again)

Brian Yennie briany at qldlearning.com
Mon Mar 15 02:11:21 EST 2004


I think we've bounced back and forth on this one...

> 7. The text should be duplicated (i.e. "to be sure" becomes "to be 
> sure to
> be sure" - Happy St Patrick's Day by the way!)

******
> in the same font, size and
> style as the original text.
*******

> On my system* the pasted text ALWAYS ends up as Lucida Grande, 11 pt,
> plain.

If you want to _preserve_ the original font, size and style of the 
original text then you MUST use clipboardData["rtf"] or 
clipboardData["html"].

If you want to discard the style information completely, there seems to 
be a bug (i.e. Rev picks up the system font by default instead of 
actually putting "plain" text on the clipboard).

I don't think the aforementioned bug is actually what is stopping you- 
you need to use clipboardData["html"] as Ken suggested.

You might see if a hidden field will help do the work for you:

set the htmlText of fld "hidden" to clipboardData["html"]
put (fld "hidden") after fld "hidden"
set the clipboardData["html"] to the htmlText of fld "hidden"

Ken also outlined how do manipulate the tags some yourself...

HTH,
Brian



More information about the use-livecode mailing list