Re: Pasting tabs into Excel

2018-02-05 Thread Richard Burkett via use-livecode
This is clearly closely related to the problem I had recently copying text from 
Livecode into Mac Mail. 
YES, Livecode should copy PLAIN text when you ask it to copy PLAIN unformatted 
text. That said, 

Here’s the script that I ended up using that work for copying a list of tabbed 
data into Excel. It’s a little different than Brian’s which he sent to help my 
question (thanks again!). It works in both cases (Mail and Excel), and is set 
up to work on three platforms.

Richard Burkett
richard.burk...@sbcglobal.net 

Here it is, as a version to copy text from a field in my test stack:

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


> From: "J. Landman Gay"  >
> 
> On 2/3/18 12:23 PM, Brian Milby via use-livecode wrote:
>> Try this function (LC 8/9):
>> 
>> *on*  stripClipboard
>>*local*  tData
>>*lock*  the clipboard
>>*put*  the rawClipboardData["public.utf8-plain-text"] into tData
>>*set*  the rawClipboardData to empty
>>*set*  the rawClipboardData["public.utf8-plain-text"] to tData
>>*unlock*  the clipboard
>> *end*  stripClipboard
>> 
>> This will ensure the only thing on the clipboard is the text format (no RTF
>> and no HTML).  Even when I use this function after putting the text on the
>> clipboard, I get the same results.  And I get the same in LC 6 & 7 too.
>> 
>> You mentioned raw clipboard, what did you try there?
> 
> Your handler works. :) I haven't used rawClipboardData much and I don't 
> have that particular experiment any more, but I think I just used the 
> example verbatim from the dictionary.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com 
> 
> HyperActive Software   | http://www.hyperactivesw.com 
> 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Problem pasting from Livecode to Mac Mail

2018-01-13 Thread Richard Burkett via use-livecode
Actually, the reason why we’re having this conversation is that I needed to 
load the clipboard with in what SHOULD be plain text format data via script, 
data that included plain returns, and it appeared as double spaced when pasted 
into Mac Mail. There was another user-driven in terms of selecting text. This 
should probably be a bug in LiveCode (the same thing happens when I copy a 
script from the editor in LiveCode). 

In any case, I found a script solution which I sent to the list (use-livecode 
Digest, Vol 172, Issue 24, item 5) and it works fine now. Perhaps LiveCode 
should have a clipBoard key “plainTextREALLY” that uses that script.

Thanks again for your help with this, Paul Hibbert.

Richard

Richard Burkett
richard.burk...@sbcglobal.net


On Fri, Jan 12, 2018 Brian Milby wrote:

> That is precisely why we are having this conversation.  An assumption was
> made that creating an HTML version of plain text was needed for the
> clipboard.
> 
> On Fri, Jan 12, 2018 at 4:51 PM Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com > wrote:
> 
>> Non- starter. Can't make assumptions about the end user's intent. What if
>> what he was copying was SUPPOSED to have double line breaks or carriage
>> returns? The complaint would be that LC was taking liberties with user's
>> data!
>> 
>> Bob S
>> 
>> 
>>> On Jan 12, 2018, at 09:42 , Brian Milby via use-livecode <
>> use-livecode@lists.runrev.com > wrote:
>>> 
>>> If it was changed to use  for single line breaks and only assuming a
>>> paragraph when there are 2
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com 
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode 
>> 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: use-livecode Digest, Vol 172, Issue 22

2018-01-10 Thread Richard Burkett via use-livecode
Thank you, Paul!
I finally got this to work in my test stack using the script below. Note that 
it has the change to “set the rawClipBoardData to empty” instead of just “set 
the ClipBoardData to empty” - that seemed to be necessary at least in LC 8.1.3 
with Mac OS X 10.12.8 Sierra which I have to use as my scripts of my main app 
don’t compile or run correctly at this point with more recent versions of 
LiveCode (but that’s another issue).

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

Quietly laughing here as I had to copy the script from LC script editor to text 
edit to avoid having double spacing!

Richard

Richard Burkett
richard.burk...@sbcglobal.net

> On Jan 10, 2018, at 11:20 AM, Paul Hibbert wrote:
> 
> This works for me with LC9.0.0(dp11) on MacOS High Sierra 10.13.2:
> 
>   lock the clipBoard
>   put the clipboardData["text"] into tClip
>   set the clipBoardData to empty
>-- OSX
>   set the rawClipboardData["public.utf8-plain-text"] \
> to textEncode(tClip, "UTF-8" )
>   unlock the clipBoard
>   -- Now Go Paste in Apple Mail
> 
> For an in-depth explanation check the ?rawClipboardData" in the dictionary.
> 
> Hope this helps.
> 
> Paul
> 
> 
>> On Jan 10, 2018, at 7:20 AM, Richard Burkett via use-livecode 
>> <use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Thanks for the suggestion, Jacqueline, but it didn?t change anything. Anyone 
>> else have a script-based solution to make sure LiveCode pastes only plain 
>> text? ASCII, Native, MacRoman - none of those text encodings work. 
>> Even putting only this line in my script results in the same thing:
>> set the clipboarddata to ( "blah" & lf & "blah" & lf & "blah" & cr & "blah" 
>> & cr & "blah" & return & "blah" )
>> 
>> What?s different about text set in the clipboard in LiveCode from other text 
>> copied from other Mac apps?
>> 
>> Richard Burkett
>> richard.burk...@sbcglobal.net <mailto:richard.burk...@sbcglobal.net>
>> 
>>> On 1/9/18 12:09 PM, Richard Burkett via use-livecode wrote:
>>>> Does anyone have a solution to this problem: I set the clipboard in 
>>>> LiveCode to the text of a field or variable that has returns after each 
>>>> line. When I paste that into Mac Mail, the text appears double-spaced as 
>>>> if it has two returns, but clearly there is just one (or a combination of 
>>>> CR and LF?). I?ve tried all the keys for setting the clipboard and also 
>>>> writing a script to delete line feeds, or CR characters, but nothing 
>>>> works. It?s either no returns, or what appears to be double-spaced returns.
>>>> 
>>>> If I paste the text first into Text Edit, then copy it, and paste into Mac 
>>>> Mail it?s fine - single line spacing. What?s LiveCode adding to each line 
>>>> that causes Mac Mail to show the pasted text as double spaced? Is there a 
>>>> way to filter/remove that?
>>> 
>>> I don't have a good way to test this, but try:
>>> 
>>> set the clipboardData to textEncode(the clipboardData,"native")
>>> 
>>> 
>>> -- 
>>> Jacqueline Landman Gay | jac...@hyperactivesw.com 
>>> <mailto:jac...@hyperactivesw.com> <mailto:jac...@hyperactivesw.com 
>>> <mailto:jac...@hyperactivesw.com>>
>>> HyperActive Software   | http://www.hyperactivesw.com 
>>> <http://www.hyperactivesw.com/> <http://www.hyperactivesw.com/ 
>>> <http://www.hyperactivesw.com/>>

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Problem pasting from Livecode to Mac Mail

2018-01-10 Thread Richard Burkett via use-livecode
Thanks for the suggestion, Jacqueline, but it didn’t change anything. Anyone 
else have a script-based solution to make sure LiveCode pastes only plain text? 
ASCII, Native, MacRoman - none of those text encodings work. 
Even putting only this line in my script results in the same thing:
set the clipboarddata to ( "blah" & lf & "blah" & lf & "blah" & cr & "blah" & 
cr & "blah" & return & "blah" )

What’s different about text set in the clipboard in LiveCode from other text 
copied from other Mac apps?

Richard Burkett
richard.burk...@sbcglobal.net

> On 1/9/18 12:09 PM, Richard Burkett via use-livecode wrote:
>> Does anyone have a solution to this problem: I set the clipboard in LiveCode 
>> to the text of a field or variable that has returns after each line. When I 
>> paste that into Mac Mail, the text appears double-spaced as if it has two 
>> returns, but clearly there is just one (or a combination of CR and LF?). 
>> I?ve tried all the keys for setting the clipboard and also writing a script 
>> to delete line feeds, or CR characters, but nothing works. It?s either no 
>> returns, or what appears to be double-spaced returns.
>> 
>> If I paste the text first into Text Edit, then copy it, and paste into Mac 
>> Mail it?s fine - single line spacing. What?s LiveCode adding to each line 
>> that causes Mac Mail to show the pasted text as double spaced? Is there a 
>> way to filter/remove that?
> 
> I don't have a good way to test this, but try:
> 
> set the clipboardData to textEncode(the clipboardData,"native")
> 
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com 
> <mailto:jac...@hyperactivesw.com>
> HyperActive Software   | http://www.hyperactivesw.com 
> <http://www.hyperactivesw.com/>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Problem pasting from Livecode to Mac Mail

2018-01-09 Thread Richard Burkett via use-livecode
Does anyone have a solution to this problem: I set the clipboard in LiveCode to 
the text of a field or variable that has returns after each line. When I paste 
that into Mac Mail, the text appears double-spaced as if it has two returns, 
but clearly there is just one (or a combination of CR and LF?). I’ve tried all 
the keys for setting the clipboard and also writing a script to delete line 
feeds, or CR characters, but nothing works. It’s either no returns, or what 
appears to be double-spaced returns. 

If I paste the text first into Text Edit, then copy it, and paste into Mac Mail 
it’s fine - single line spacing. What’s LiveCode adding to each line that 
causes Mac Mail to show the pasted text as double spaced? Is there a way to 
filter/remove that?

Richard Burkett
richard.burk...@sbcglobal.net



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode