use-livecode Digest, Vol 172, Issue 22

Brian Milby brian at milby7.com
Thu Jan 11 15:43:34 EST 2018


The problem in this case is the HTML format data (and possibly RTF) on the
clipboard. Testing in Windows, if I just put the LC styled text and plain
text on the clipboard, it works to get plain text outside of LC but retain
formatting inside. If I try to paste the RTF or LC data into Excel, I just
get a beep. HTML gives the double space text. The plain text formats work
as expected. So if the destination application accepts HTML, that is what
it takes.

This does not mean that the clipboard data is necessarily correct right
now. I’m not sure wrapping single spaced text in <P> tags is correct. I’m
not an expert there, so this may be an area that could be improved.
On Thu, Jan 11, 2018 at 1:51 PM Richard Gaskin via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Richard Burkett wrote:
>
>  > on mouseUp
>  >    put fld "myField" into tClip
>  >    lock the clipBoard
>  >    set the ClipboardData to empty
>  >    set the ClipboardData to tClip
>  >    put the clipboardData["text"] into tClip
>  >    set the rawclipBoardData to empty
>  >    if the platform is "MacOS" then
>  >       set the rawClipboardData["public.utf8-plain-text"] \
>  >             to textEncode(tClip, "UTF-8" )   -- OSX
>  >    else if the platform is "Linux" then
>  >       set the rawClipboardData["text/plain;charset=utf-8"] \
>  >             to textEncode(tClip, "UTF-8" ) -- Linux
>  >    else if the platform contains "Win" then
>  >       set the rawClipboardData["CF_UNICODE"] \
>  >             to textEncode(tClip, "UTF-16" ) -- Windows
>  >    end if
>  >    unlock the clipBoard
>  > end mouseUp
>
> Nice, but not as nice as:
>
>    copy
>
> I appreciate that we have the flexibility to do arcane things with the
> Clipboard when needed, but shouldn't the copy command handle the most
> common cases without requiring new users to research and experiment in
> the hope of arriving at the above block of code?
>
> --
>   Richard Gaskin
>   Fourth World Systems
>   Software Design and Development for the Desktop, Mobile, and the Web
>   ____________________________________________________________________
>   Ambassador at FourthWorld.com                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list