clipboarddata["html"] problem

pmbrig at pmbrig at
Wed Mar 22 11:21:28 EST 2006

I am using a button to put a text field on the clipboard. I set the clipboarddata["html"] to the htmltext of the field, then when I try to paste into MS Word, my field formatting does not come through. Instead, the default textFont and textSize for the stack is what determines the format of the pasted text -- I have experimented with this, and changing the field properties has zero effect on the paste, whereas changing the stack properties changes the paste. As an added complication, though, setting the textFont of the stack works perfectly, but when I set the textSize of the stack to 10, it comes through as 12. All other sizes work the way they are supposed to: stack textSize of 9 results in size 9 text in the paste, stack textSize of 14 comes through as 14, etc. Only stack textSize of 10 comes through as 12.

here's the relevant portion of the script:

put fld "wordPath" into wordpath
put fld "letterPath" into letterPath
put theHdr into fld "formatPrintText"
set the textFont of fld "formatPrintText" to "Bookman Old Style"
set the textSize of fld "formatPrintText" to "10"
set the clipboarddata["html"] to the htmltext of fld "formatPrintText"
set the clipboarddata["text"] to theHdr -- * see below
launch letterPath with wordpath

* (I've tried not setting the clipboarddata["text"] and it makes no difference.)

I'm puzzled. The clipboarddata["html"] clearly is not getting set properly. I am using Dreamcard v2.6.1 build 152 on a Mac iBook running OSX v10.4.5, and Word for Mac v11.2.3. The problem with the size 10 getting seen as size 12 appears to be a Word problem, since the paste into another text app comes through as expected.

Why doesn't the htmlText of the field get onto the clipboard?
Why in the world should the default text properties of the stack have any effect here?

Peter M. Brigham

More information about the Use-livecode mailing list