Re: Problem pasting from Livecode to Mac Mail

2018-01-13 Thread Brian Milby via use-livecode
PR submitted against develop-8.2:
https://github.com/livecode/livecode/pull/6276

Updated MCClipboard::AddText such that is will clear the clipboard and only
place the plain text representations on the clipboard. The clipboard needed
to be cleared to avoid the HTML/RTF from a previous copy being left on the
clipboard which would cause issues when attempting to paste.

This will fix bugs 19206 and 20336.

Bug 18699 is actually due to the inclusion of HTML on the clipboard from my
testing (Mac/Windows).  TextEdit on the Mac places RTF and plain text on
the clipboard and does not suffer from the same issue when pasting into
Excel (which is why people were able to paste there and recopy to get
around the issue).

Have a good weekend everyone!

On Sat, Jan 13, 2018 at 11:27 AM, Brian Milby  wrote:

> PR just about done actually. It sets the plain text but leaves previous
> HTML right now. Should have it done this weekend.
>
> On Sat, Jan 13, 2018 at 10:50 AM Mark Waddingham via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> The behaviour should be that if you put plaintext then only plaintext
>> should be on the clipboard...
>>
>> If you put styled text then plain and rtf should be on the clipboard...
>> HTML maybe - but if that's the format causing the problem (and not rtf -
>> which I think is the main Cocoa style interchange format) then that needs
>> some thought.
>>
>> A line in a field is a paragraph - you can put vertical tabs in a line to
>> give you hard line breaks (i.e. BR in html). If other apps are interpreting
>> this differently then that causes a 'roundtrip' issue for LiveCode.
>>
>> Anyway, this is a result of the reworking of the clipboard we did early
>> on in 8 (maybe late 7) - if you have the time to poke around and propose a
>> patch on more than happy to help - it's been on my list to dig into for
>> ages, but hasn't reached the top yet!
>>
>> Warmest Regards,
>>
>> Mark.
>>
>> Sent from my iPhone
>>
>> > On 13 Jan 2018, at 15:16, Brian Milby via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> > The text on the clipboard is fine. The problem is that too much is put
>> on
>> > the clipboard. Plain text converted to HTML is likely the real problem.
>> > That is why a trip through a plain text editor fixes the issue. It takes
>> > the plain text from the clipboard and only puts plain text on the
>> > clipboard. There are 2 bug reports on this issue. I’m planning on
>> > submitting a PR but was waiting for any reasoning behind the current
>> method
>> > that I may have overlooked.
>> > On Sat, Jan 13, 2018 at 9:11 AM Richard Burkett via use-livecode <
>> > use-livecode@lists.runrev.com> wrote:
>> >
>> >> 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 <
>> >> 

Re: Problem pasting from Livecode to Mac Mail

2018-01-13 Thread Brian Milby via use-livecode
PR just about done actually. It sets the plain text but leaves previous
HTML right now. Should have it done this weekend.
On Sat, Jan 13, 2018 at 10:50 AM Mark Waddingham via use-livecode <
use-livecode@lists.runrev.com> wrote:

> The behaviour should be that if you put plaintext then only plaintext
> should be on the clipboard...
>
> If you put styled text then plain and rtf should be on the clipboard...
> HTML maybe - but if that's the format causing the problem (and not rtf -
> which I think is the main Cocoa style interchange format) then that needs
> some thought.
>
> A line in a field is a paragraph - you can put vertical tabs in a line to
> give you hard line breaks (i.e. BR in html). If other apps are interpreting
> this differently then that causes a 'roundtrip' issue for LiveCode.
>
> Anyway, this is a result of the reworking of the clipboard we did early on
> in 8 (maybe late 7) - if you have the time to poke around and propose a
> patch on more than happy to help - it's been on my list to dig into for
> ages, but hasn't reached the top yet!
>
> Warmest Regards,
>
> Mark.
>
> Sent from my iPhone
>
> > On 13 Jan 2018, at 15:16, Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > The text on the clipboard is fine. The problem is that too much is put on
> > the clipboard. Plain text converted to HTML is likely the real problem.
> > That is why a trip through a plain text editor fixes the issue. It takes
> > the plain text from the clipboard and only puts plain text on the
> > clipboard. There are 2 bug reports on this issue. I’m planning on
> > submitting a PR but was waiting for any reasoning behind the current
> method
> > that I may have overlooked.
> > On Sat, Jan 13, 2018 at 9:11 AM Richard Burkett via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> 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 <
> >> 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
> > ___
> > 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
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this 

Re: Problem pasting from Livecode to Mac Mail

2018-01-13 Thread Mark Waddingham via use-livecode
The behaviour should be that if you put plaintext then only plaintext should be 
on the clipboard...

If you put styled text then plain and rtf should be on the clipboard... HTML 
maybe - but if that's the format causing the problem (and not rtf - which I 
think is the main Cocoa style interchange format) then that needs some thought.

A line in a field is a paragraph - you can put vertical tabs in a line to give 
you hard line breaks (i.e. BR in html). If other apps are interpreting this 
differently then that causes a 'roundtrip' issue for LiveCode.

Anyway, this is a result of the reworking of the clipboard we did early on in 8 
(maybe late 7) - if you have the time to poke around and propose a patch on 
more than happy to help - it's been on my list to dig into for ages, but hasn't 
reached the top yet!

Warmest Regards,

Mark.

Sent from my iPhone

> On 13 Jan 2018, at 15:16, Brian Milby via use-livecode 
>  wrote:
> 
> The text on the clipboard is fine. The problem is that too much is put on
> the clipboard. Plain text converted to HTML is likely the real problem.
> That is why a trip through a plain text editor fixes the issue. It takes
> the plain text from the clipboard and only puts plain text on the
> clipboard. There are 2 bug reports on this issue. I’m planning on
> submitting a PR but was waiting for any reasoning behind the current method
> that I may have overlooked.
> On Sat, Jan 13, 2018 at 9:11 AM Richard Burkett via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> 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 <
>> 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
> ___
> 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: Problem pasting from Livecode to Mac Mail

2018-01-13 Thread Brian Milby via use-livecode
The text on the clipboard is fine. The problem is that too much is put on
the clipboard. Plain text converted to HTML is likely the real problem.
That is why a trip through a plain text editor fixes the issue. It takes
the plain text from the clipboard and only puts plain text on the
clipboard. There are 2 bug reports on this issue. I’m planning on
submitting a PR but was waiting for any reasoning behind the current method
that I may have overlooked.
On Sat, Jan 13, 2018 at 9:11 AM Richard Burkett via use-livecode <
use-livecode@lists.runrev.com> wrote:

> 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 <
> 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
___
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: Problem pasting from Livecode to Mac Mail

2018-01-12 Thread Brian Milby via use-livecode
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: Problem pasting from Livecode to Mac Mail

2018-01-12 Thread Bob Sneidar via use-livecode
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 
>  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


Re: Problem pasting from Livecode to Mac Mail

2018-01-12 Thread Brian Milby via use-livecode
So there are 2 issues with how LiveCode is handling placing text onto the
clipboard:
- converting plain text to HTML on the clipboard
- using  tags for each line break when converting to HTML

I’m not sure of the reasoning behind the first issue. I understand wanting
to have the native LC format for rich text, but if placing plain text on
the clipboard, I think that the user wants plain text and not HTML.

The second issue may take some additional thought/discussion. Looking at
the code, it uses the  tag to wrap attributes, so eliminating it
globally isn’t an option. Magic happens here:

fieldhtml.cpp / export_html_emit_paragraphs
fieldh.cpp / MCField::doexport

If it was changed to use  for single line breaks and only assuming a
paragraph when there are 2, that would probably take care of it in most
cases. Paragraphs are split by /n here (internal LC styled text
representation):

fieldh.cpp / MCField::texttoparagraphs

Still digging...
On Fri, Jan 12, 2018 at 3:23 AM Peter Reid via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Sorry, forgot to change Subject in previous posting...
>
> Hi Richard
>
> I found this problem was particularly annoying when trying to extract info
> from vCards exported from Contacts on the Mac, so I developed a tiny app in
> LC called vCardClipper.
>
> I've put together a web page about this app together with download links
> to a Mac App and the source code.  Here's the link to this web page, help
> yourself:
>
> https://www.reid-it.co.uk/downloads/downvcclip.htm
>
> The key is to paste HTML format text into Mail replacing RETURN with
> "" and replacing spaces with "". The code is in the following
> handler (which is in the stack script):
>
> on loadClipboard pPlainText, pPasteMode
>-- pPasteMode: HTML or text
>set itemDelimiter to "."
>put item 1 of the version into tLCversion
>lock the clipboard
>if tLCversion >= "8" then
>   -- for LC 8.x or later:
>   set the fullClipboardData to empty
>   switch pPasteMode
>  case "HTML"
> put pPlainText into tHTMLtext
> replace return with "" in tHTMLtext
> replace space with "" in tHTMLtext
> set the fullClipboardData["HTML"] to "" & tHTMLtext & ""
> break
>  case "text"
> set the fullClipboardData["text"] to pPlainText
> break
>   end switch
>else
>   -- for LC 7.x or earlier:
>   switch pPasteMode
>  case "HTML"
> put pPlainText into tHTMLtext
> replace return with "" in tHTMLtext
> replace space with "" in tHTMLtext
> set the clipboardData["HTML"] to "" & tHTMLtext & ""
> break
>  case "text"
> set the clipboardData["text"] to pPlainText
> break
>   end switch
>end if
>    unlock the clipboard
> end loadClipboard
>
>
> Peter
> --
> Peter Reid
> Loughborough, UK
>
> > On 10 Jan 2018, at 9:38am, use-livecode-requ...@lists.runrev.com wrote:
> >
> > Message: 5
> > Date: Tue, 9 Jan 2018 10:09:51 -0800
> > From: Richard Burkett <richard.burk...@sbcglobal.net>
> > To: use-livecode@lists.runrev.com
> > Subject: Problem pasting from Livecode to Mac Mail
> > Message-ID: <bf402ecc-c11d-4526-82c2-b5267520d...@sbcglobal.net>
> > Content-Type: text/plain; charset=utf-8
> >
> > 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
>
___
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-12 Thread Peter Reid via use-livecode
Sorry, forgot to change Subject in previous posting...

Hi Richard

I found this problem was particularly annoying when trying to extract info from 
vCards exported from Contacts on the Mac, so I developed a tiny app in LC 
called vCardClipper.

I've put together a web page about this app together with download links to a 
Mac App and the source code.  Here's the link to this web page, help yourself:

https://www.reid-it.co.uk/downloads/downvcclip.htm

The key is to paste HTML format text into Mail replacing RETURN with "" and 
replacing spaces with "". The code is in the following handler (which is 
in the stack script):

on loadClipboard pPlainText, pPasteMode
   -- pPasteMode: HTML or text
   set itemDelimiter to "."
   put item 1 of the version into tLCversion
   lock the clipboard
   if tLCversion >= "8" then
  -- for LC 8.x or later:
  set the fullClipboardData to empty
  switch pPasteMode
 case "HTML"
put pPlainText into tHTMLtext
replace return with "" in tHTMLtext
replace space with "" in tHTMLtext
set the fullClipboardData["HTML"] to "" & tHTMLtext & ""
break
 case "text"
set the fullClipboardData["text"] to pPlainText
break
  end switch
   else
  -- for LC 7.x or earlier:
  switch pPasteMode
 case "HTML"
put pPlainText into tHTMLtext
replace return with "" in tHTMLtext
replace space with "" in tHTMLtext
set the clipboardData["HTML"] to "" & tHTMLtext & ""
break
 case "text"
set the clipboardData["text"] to pPlainText
break
  end switch
   end if
   unlock the clipboard
end loadClipboard


Peter
--
Peter Reid
Loughborough, UK

> On 10 Jan 2018, at 9:38am, use-livecode-requ...@lists.runrev.com wrote:
> 
> Message: 5
> Date: Tue, 9 Jan 2018 10:09:51 -0800
> From: Richard Burkett <richard.burk...@sbcglobal.net>
> To: use-livecode@lists.runrev.com
> Subject: Problem pasting from Livecode to Mac Mail
> Message-ID: <bf402ecc-c11d-4526-82c2-b5267520d...@sbcglobal.net>
> Content-Type: text/plain; charset=utf-8
> 
> 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


Re: Problem pasting from Livecode to Mac Mail

2018-01-10 Thread Paul Hibbert via use-livecode
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 
>  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
> 
>> 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 
>> 
>> 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


___
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 Mike Bonner via use-livecode
Does this work?

set the clipboarddata["text"] to "whatever text here"

On Wed, Jan 10, 2018 at 8:20 AM, Richard Burkett via use-livecode <
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
>
> > 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  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
___
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 
> 
> 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-09 Thread Paul Hibbert via use-livecode
I use a small utility called PopClip, I wouldn’t be without it (although it 
does have some issues with LC on occasions), but it does allow you to choose to 
paste plain text if you wish along with lots of other useful copy/paste 
options. Saves me from some frustration.

It’s available on the App store. More info from pilotmoon.com if that helps.

Paul

> On Jan 9, 2018, at 11:55 AM, J. Landman Gay via use-livecode 
>  wrote:
> 
> 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
> 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


___
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-09 Thread J. Landman Gay via use-livecode

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
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

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