use-livecode Digest, Vol 172, Issue 22

Richard Gaskin ambassador at fourthworld.com
Thu Jan 11 14:50:53 EST 2018


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




More information about the use-livecode mailing list