Clipboarddate differences
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Clipboarddate differences
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
Larry
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Clipboarddate differences
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).
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
Re: Clipboarddate differences
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
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
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Clipboarddate differences
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
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
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Clipboarddate differences
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
HyperActive Software | http://www.hyperactivesw.com
Re: Clipboarddate differences
Thanks -hh,
I have submitted a bug report for this. It is #20026.
larry
I have submitted a bug report for this. It is #20026.
larry
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Clipboarddate differences
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.
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
HyperActive Software | http://www.hyperactivesw.com
Re: Clipboarddate differences
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
Larry
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Clipboarddate differences
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
HyperActive Software | http://www.hyperactivesw.com