Page 1 of 1

Clipboarddate differences

Posted: Thu Jul 06, 2017 4:44 am
by lohill
If I copy table data from a web page and then in script say 'put the clipboarddata into tClip" i get different results depending on whether I use LC version 7.1.3 or LC version 9.0.0 (dp 7). In the 7.1.3 I get lines of tab delimited data while in version 9.0.0 I get lines but each line consists of single item. Have changes been made to clipboardata?

Larry

Re: Clipboarddate differences

Posted: Sat Jul 08, 2017 9:10 am
by [-hh]
TMHO, the changes are caused by both the browser (its textencoding) and LC's textencoding.
Often it helps to paste temporary into "TextEdit" or "Notepad" to have it changed to a format that is 'correct' in your sense.

To see another example of such different handling of line endings:
When copying in MacOS 10.12 from the LC 9-ScriptEditor to Apple's Mail you get an empty line after each written line, what disappears when pasting into TextEdit (translates line endings).

Re: Clipboarddate differences

Posted: Sun Jul 09, 2017 1:24 am
by lohill
Thanks for the ideas -hh. I tried pasting in TextEdit first and then copying that and pasting in my application in version 9. I still end up with each item (or what should be a tab delimited item) on a separate line.

This is what tClip looks like in version 7:
TIER Bought 20170706XME3068 0GFAC03K 1935 $18.1295 35,085.53 12:08:00 PM 7/6/2017 7/11/2017
ANTM Bought 20170705XNG2011 0GEAC2KD 241 $190.992 46,034.02 11:38:00 AM 7/5/2017 7/10/2017
TIER Bought 20170705XGE4126 600 $18.171 10,907.55 11:36:00 AM 7/5/2017 7/10/2017

And this is what tClip looks like in version 9:
TIER
Bought

20170706XME3068

0GFAC03K

1935

$18.1295

35,085.53

12:08:00 PM

7/6/2017

7/11/2017

ANTM
Bought

20170705XNG2011

0GEAC2KD

241

$190.992

46,034.02

11:38:00 AM

7/5/2017

7/10/2017

TIER
Bought

Tax Lot 20170705XGE4126


600

$18.171

10,907.55

11:36:00 AM

7/5/2017

7/10/2017

To me it is clear that version 9 does something to the clipboard that it does not do in version 7.

Larry

Re: Clipboarddate differences

Posted: Sun Jul 09, 2017 3:04 am
by [-hh]
Below is a link to a thread about a related problem with line endings, perhaps it can give you a hint for using the rawClipboardData and fullClipboardData.
But I've never seen that a tab is converted to two newlines, you certainly should report this ( quality.livecode.com ).

http://lists.runrev.com/pipermail/use-l ... 34512.html
especially
http://lists.runrev.com/pipermail/use-l ... 34623.html

Re: Clipboarddate differences

Posted: Sun Jul 09, 2017 4:11 pm
by jacque
Can you give an example web page we can look at? I'm guessing you need to use either urlDecode or textDecode on the data.

Re: Clipboarddate differences

Posted: Sun Jul 09, 2017 8:44 pm
by lohill
Thanks -hh,

I have submitted a bug report for this. It is #20026.

larry

Re: Clipboarddate differences

Posted: Sun Jul 09, 2017 10:41 pm
by jacque
Interesting...your sample text goes into BBEdit the same way, as many multiple lines, so it's not just LC. However, when manually pasting it into a LiveCode field it goes in correctly, so there's a way to do it but I haven't tracked it down in the IDE scripts. At any rate, it looks more like a translation problem than a bug to me.

Edit: second try, it stopped working. I'd posted a snippet that did a correct translation and then deleted it because copying it a second time didn't work. A puzzle. But BBEdit still always pastes the text as multiple lines.

Re: Clipboarddate differences

Posted: Mon Jul 17, 2017 9:09 pm
by lohill
Thanks for looking into this Jacque. It is definitely different and definitely interesting. The bug report (20026) has the status UNCONFIRMED followed by EXPERT_REVIEW. Are you familiar with what that means?

Larry

Re: Clipboarddate differences

Posted: Tue Jul 18, 2017 12:30 am
by jacque
Expert review means Mark Waddingham needs to look at it and decide, the initial reviewer couldn't tell.