characters lost pasting from Word To LiveCode field

Bob Sneidar bobs at
Tue Dec 13 19:27:17 EST 2011

Pasting from Office applications has been discussed in length in prior threads, but the gist of it is, Microsoft maintains their own internal clipboard to facilitate pasting between their dissimilar applications, so that a range of cells copied from a spreadsheet can be pasted into a word document as an active link or a table object etc. 

When you paste in another non-Microsoft app, MS does a clipboard conversion to make it compatible with the receiving app. I believe you are discovering some of the limitations to that. 

Now I just copied an emdash, switched to Livecode, and then entered put chartonum(the clipboardData) into the message box and got blank. I then copied the emdash from Word, pasted it into a rich text textedit document, copied it again, then issued the same command. 

In the first instance I got empty. In the second I got 209. That tells me that Word is performing a clipboard conversion for Livecode that kills the character. The clipboard conversion for textedit works just fine. 

Whose fault is it do you ask? Beats the heck out of me! Pick a number from Runrev to Microsoft. 


On Dec 13, 2011, at 3:09 PM, Sieg Lindstrom wrote:

> I use a LiveCode app (OSX) to parse text taken from Word files, glean
> relevant data, write records to a database and also reformat the original
> text in certain ways. I copy and paste text from Word into a field in my
> app, click a button and it does the rest, until I upgraded to 5.0x.
> I'll say up front the details of text encoding are not my strong suit. With
> earlier versions (RunRev 4.x and earlier), I'd sometimes have to write
> special routines to search and replace certain characters from the pasted
> text. For example, the em-dash, "—" (chartonum 209), which after pasting
> from Word was seen by RunRev as two characters (a two-byte character?),
> numtochar of 32 followed by numtochar of 20 so I wrote a routine to just
> search and replace to numToChar of 209. My new problem is that with LiveCode
> 5.0x (I just upgraded to 5.02), the em-dash if pasted from a Word file
> instantly disappears from the text.
> This...
> Berlin, Germany, December 12—
> becomes this...
> Berlin, Germany, December 12
> This probably affects other characters; I'm not yet sure which ones. Any
> suggestions how I can seamlessly copy and paste the em-dash and other
> characters like it from Word to a LiveCode field? The only workaround, very
> inelegant, that I've found is to copy and paste from Word to TextEdit and
> then from TextEdit to LiveCode app. Not a welcome extra step. Thanks in
> advance.
> Sieg
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the Use-livecode mailing list