Clipboarddate differences

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
lohill
Posts: 724
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Clipboarddate differences

Post by lohill » Thu Jul 06, 2017 4:44 am

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

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1538
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Clipboarddate differences

Post by [-hh] » Sat Jul 08, 2017 9:10 am

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).
shiftLock happens

lohill
Posts: 724
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Re: Clipboarddate differences

Post by lohill » Sun Jul 09, 2017 1:24 am

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

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1538
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Clipboarddate differences

Post by [-hh] » Sun Jul 09, 2017 3:04 am

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3922
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Clipboarddate differences

Post by jacque » Sun Jul 09, 2017 4:11 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

lohill
Posts: 724
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Re: Clipboarddate differences

Post by lohill » Sun Jul 09, 2017 8:44 pm

Thanks -hh,

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

larry

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3922
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Clipboarddate differences

Post by jacque » Sun Jul 09, 2017 10:41 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

lohill
Posts: 724
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Re: Clipboarddate differences

Post by lohill » Mon Jul 17, 2017 9:09 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3922
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Clipboarddate differences

Post by jacque » Tue Jul 18, 2017 12:30 am

Expert review means Mark Waddingham needs to look at it and decide, the initial reviewer couldn't tell.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”