Different result in LC 6 to LC 8 when copying field text into Excel?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
Hello,

I have a standard scrolling list field with multiple lines of text. I copy
the text by:

*set the clipboarddata["text"] to fld "List"*

The User now can past the text into MS Excel on Windows. With LC 6 the text
was pasted into Excel line by line, as it showed up in LC. In LC 8.1.2 the
text is pasted with an extra space line between each two lines.

I checked the line ends in both versions. There is only one "LF"
(byteToNum=10) at the end of each line and it looks the same in both
versions.

What has changed in LC 8 to cause such a different behavior? Is this again a
Unicode thing what I don't understand? I already tried different
clipboarddata keys, without success.

It can't be an Excel option, because I tested it with the same Excel version
on the same machine.

Any idea, what has to be changed to get the same clipboard result as in LC
6?

Thank you

Tiemo

 

 

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

AW: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
Can anybody on Windows with LC 8 confirm this:

- create a new stack
- create a scrolling list field
- enter three lines of text, each with one word
- enter into the message box: *set the clipboarddata["text"] to fld 1*
- open MS Excel (in my case Windows 10, Excel 2013)
- paste
- see an extra empty line between each line of text

Pasted in a text editor there are no extra lines and up to LC 7 there also
was no extra line in Excel.

Can anybody confirm this behavior or even has an idea for a workaround?

Thanks
Tiemo



-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:[hidden email]] Im Auftrag
von Tiemo Hollmann TB via use-livecode
Gesendet: Donnerstag, 2. Februar 2017 12:13
An: LiveCode User Liste senden <[hidden email]>
Cc: Tiemo Hollmann TB <[hidden email]>
Betreff: Different result in LC 6 to LC 8 when copying field text into
Excel?

Hello,

I have a standard scrolling list field with multiple lines of text. I copy
the text by:

*set the clipboarddata["text"] to fld "List"*

The User now can past the text into MS Excel on Windows. With LC 6 the text
was pasted into Excel line by line, as it showed up in LC. In LC 8.1.2 the
text is pasted with an extra space line between each two lines.

I checked the line ends in both versions. There is only one "LF"
(byteToNum=10) at the end of each line and it looks the same in both
versions.

What has changed in LC 8 to cause such a different behavior? Is this again a
Unicode thing what I don't understand? I already tried different
clipboarddata keys, without success.

It can't be an Excel option, because I tested it with the same Excel version
on the same machine.

Any idea, what has to be changed to get the same clipboard result as in LC
6?

Thank you

Tiemo

 

 

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

AW: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
the headquarter could confirm this interaction to Excel bug and pointed me
to the workaround with "paste special as text"
Tiemo

-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:[hidden email]] Im Auftrag
von Tiemo Hollmann TB via use-livecode
Gesendet: Freitag, 3. Februar 2017 15:26
An: 'How to use LiveCode' <[hidden email]>
Cc: Tiemo Hollmann TB <[hidden email]>
Betreff: AW: Different result in LC 6 to LC 8 when copying field text into
Excel?

Can anybody on Windows with LC 8 confirm this:

- create a new stack
- create a scrolling list field
- enter three lines of text, each with one word
- enter into the message box: *set the clipboarddata["text"] to fld 1*
- open MS Excel (in my case Windows 10, Excel 2013)
- paste
- see an extra empty line between each line of text

Pasted in a text editor there are no extra lines and up to LC 7 there also
was no extra line in Excel.

Can anybody confirm this behavior or even has an idea for a workaround?

Thanks
Tiemo



-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:[hidden email]] Im Auftrag
von Tiemo Hollmann TB via use-livecode
Gesendet: Donnerstag, 2. Februar 2017 12:13
An: LiveCode User Liste senden <[hidden email]>
Cc: Tiemo Hollmann TB <[hidden email]>
Betreff: Different result in LC 6 to LC 8 when copying field text into
Excel?

Hello,

I have a standard scrolling list field with multiple lines of text. I copy
the text by:

*set the clipboarddata["text"] to fld "List"*

The User now can past the text into MS Excel on Windows. With LC 6 the text
was pasted into Excel line by line, as it showed up in LC. In LC 8.1.2 the
text is pasted with an extra space line between each two lines.

I checked the line ends in both versions. There is only one "LF"
(byteToNum=10) at the end of each line and it looks the same in both
versions.

What has changed in LC 8 to cause such a different behavior? Is this again a
Unicode thing what I don't understand? I already tried different
clipboarddata keys, without success.

It can't be an Excel option, because I tested it with the same Excel version
on the same machine.

Any idea, what has to be changed to get the same clipboard result as in LC
6?

Thank you

Tiemo

 

 

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
Beat me to it and good to know.
Paste special as Unicode Text also works but Paste special as HTML does not.

As a wrinkle... pasting into NotePad has no line feeds (e.g. gives " Line
1Line 2Line 3")
Copying that from NotePad and pasting into LC, Word, Excel, etc.  gives
correct result (meaning 3 different lines)

Still too wonky for me to use I'm afraid.
My users are simple "copy and pasters" and asking them to do different
flavors of Paste isn't going to work.

Jim

-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf
Of Tiemo Hollmann TB via use-livecode
Sent: Friday, February 03, 2017 8:53 AM
To: 'How to use LiveCode'
Cc: Tiemo Hollmann TB
Subject: AW: Different result in LC 6 to LC 8 when copying field text into
Excel?

the headquarter could confirm this interaction to Excel bug and pointed me
to the workaround with "paste special as text"
Tiemo

-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:[hidden email]] Im Auftrag
von Tiemo Hollmann TB via use-livecode
Gesendet: Freitag, 3. Februar 2017 15:26
An: 'How to use LiveCode' <[hidden email]>
Cc: Tiemo Hollmann TB <[hidden email]>
Betreff: AW: Different result in LC 6 to LC 8 when copying field text into
Excel?

Can anybody on Windows with LC 8 confirm this:

- create a new stack
- create a scrolling list field
- enter three lines of text, each with one word
- enter into the message box: *set the clipboarddata["text"] to fld 1*
- open MS Excel (in my case Windows 10, Excel 2013)
- paste
- see an extra empty line between each line of text

Pasted in a text editor there are no extra lines and up to LC 7 there also
was no extra line in Excel.

Can anybody confirm this behavior or even has an idea for a workaround?

Thanks
Tiemo



-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:[hidden email]] Im Auftrag
von Tiemo Hollmann TB via use-livecode
Gesendet: Donnerstag, 2. Februar 2017 12:13
An: LiveCode User Liste senden <[hidden email]>
Cc: Tiemo Hollmann TB <[hidden email]>
Betreff: Different result in LC 6 to LC 8 when copying field text into
Excel?

Hello,

I have a standard scrolling list field with multiple lines of text. I copy
the text by:

*set the clipboarddata["text"] to fld "List"*

The User now can past the text into MS Excel on Windows. With LC 6 the text
was pasted into Excel line by line, as it showed up in LC. In LC 8.1.2 the
text is pasted with an extra space line between each two lines.

I checked the line ends in both versions. There is only one "LF"
(byteToNum=10) at the end of each line and it looks the same in both
versions.

What has changed in LC 8 to cause such a different behavior? Is this again a
Unicode thing what I don't understand? I already tried different
clipboarddata keys, without success.

It can't be an Excel option, because I tested it with the same Excel version
on the same machine.

Any idea, what has to be changed to get the same clipboard result as in LC
6?

Thank you

Tiemo

 

 

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
On Fri, Feb 3, 2017 at 9:39 AM, Jim MacConnell via use-livecode <
[hidden email]> wrote:

> Still too wonky for me to use I'm afraid.
> My users are simple "copy and pasters" and asking them to do different
> flavors of Paste isn't going to work.
>

MANY apps have paste special or paste as... items in their edit menus -
obviously they've faced the same issues.

--
Stephen Barncard - Sebastopol Ca. USA -
mixstream.org
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Browser widget and websites that open content in a tab or window

JOHN PATTEN via use-livecode
The links on a website displayed in a browser widget work fine when they are of the form:

https://www.NotRealSite.***<https://www.notrealsite.***>


but nothing happens in the Livecode browser widget if the links are part of a javascript element that attempts to open the site in a new tab.

Is there any way to deal with this problem without rewriting the web site?

Thanks,
Tim Bleiler, Ph.D.
Instructional Designer, HSIT
University at Buffalo

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
In reply to this post by JOHN PATTEN via use-livecode
On Thu, Feb 2, 2017 at 5:13 AM, Tiemo Hollmann TB via use-livecode <
[hidden email]> wrote:

> I have a standard scrolling list field with multiple lines of text. I copy
> the text by:
>
> *set the clipboarddata["text"] to fld "List"*
>
> The User now can past the text into MS Excel on Windows. With LC 6 the text
> was pasted into Excel line by line, as it showed up in LC. In LC 8.1.2 the
> text is pasted with an extra space line between each two lines.
>
> I checked the line ends in both versions. There is only one "LF"
> (byteToNum=10) at the end of each line and it looks the same in both
> versions.
>
> What has changed in LC 8 to cause such a different behavior? Is this again
> a
> Unicode thing what I don't understand? I already tried different
> clipboarddata keys, without success.
>

I wonder if this is related to the following bug where pasting into Notepad
strips all newlines. It would appear that LC 8 is having trouble putting
new lines on the clipboard properly.

http://quality.livecode.com/show_bug.cgi?id=17524

--
Trevor DeVore
Outcome & ScreenSteps
www.outcomeapp.io     -     www.screensteps.com
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
If it helps, it may be a Mac OS issue. If I open a text file exported from a Toshiba copier, like the address book let's say, then open it with a text editor like SimpleText, and then save it, I cannot reimport the text file. The copier thinks that the file is unreadable. This happens with other Mac OS apps like Excel and Word. Someone at Apple thought it was a good idea to just help us out by replacing foreign line wraps to carriage returns. Oh, and not tell us they were doing it.

Bob S


On Feb 5, 2017, at 17:43 , Trevor DeVore via use-livecode <[hidden email]<mailto:[hidden email]>> wrote:

I wonder if this is related to the following bug where pasting into Notepad
strips all newlines. It would appear that LC 8 is having trouble putting
new lines on the clipboard properly.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
In reply to this post by JOHN PATTEN via use-livecode
Tiemo,

I’m not sure if this will help because I’m testing on Mac, but I did a little bit of experimenting with the new ‘rawClipboardData’, it allows plain text to be copied out of LC, just to prove it, here’s a button script copied via my now modified Script Buddy plugin…

on mouseUp
   local tClip

   if the selectedText is empty then
      set the clipBoardData["text"] to fld “myTextField"
   else
      copy the selectedText
   end if
   
   if the altKey is down then -- Convert the clipBoard to plain text
      put the clipBoardData["text"] into tClip
      lock the clipBoard
      ## Use some code lifted from the LiveCode Dictionary…
      set the rawClipBoardData to empty -- Clear ALL ClipboardData
      if the platform is "Linux" then set the rawClipboardData["text/plain;charset=utf-8"] \
            to textEncode(tClip, "UTF-8" ) -- Linux
      if the platform is "Win32" then set the rawClipboardData["CF_UNICODE"] \
            to textEncode(tClip, "UTF-16" ) -- Windows
      if the platform is "MacOS" then set the rawClipboardData["public.utf8-plain-text"] \
            to textEncode(tClip, "UTF-8" ) -- OSX
      unlock the clipboard
   end if
end mouseUp

At last, no extra line spacing! :-)

Normally when I paste from LC into Mail I see extra line spacing, and I would have to copy and paste via a plain text editor to remove it. Emptying the clipBoard and setting the rawClipboardData as above seems to work, on Mac at least, hopefully it should work with Excel on Windows too.

Paul




> On Feb 3, 2017, at 6:25 AM, Tiemo Hollmann TB via use-livecode <[hidden email]> wrote:
>
> Can anybody on Windows with LC 8 confirm this:
>
> - create a new stack
> - create a scrolling list field
> - enter three lines of text, each with one word
> - enter into the message box: *set the clipboarddata["text"] to fld 1*
> - open MS Excel (in my case Windows 10, Excel 2013)
> - paste
> - see an extra empty line between each line of text
>
> Pasted in a text editor there are no extra lines and up to LC 7 there also
> was no extra line in Excel.
>
> Can anybody confirm this behavior or even has an idea for a workaround?
>
> Thanks
> Tiemo
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: use-livecode [mailto:[hidden email]] Im Auftrag
> von Tiemo Hollmann TB via use-livecode
> Gesendet: Donnerstag, 2. Februar 2017 12:13
> An: LiveCode User Liste senden <[hidden email]>
> Cc: Tiemo Hollmann TB <[hidden email]>
> Betreff: Different result in LC 6 to LC 8 when copying field text into
> Excel?
>
> Hello,
>
> I have a standard scrolling list field with multiple lines of text. I copy
> the text by:
>
> *set the clipboarddata["text"] to fld "List"*
>
> The User now can past the text into MS Excel on Windows. With LC 6 the text
> was pasted into Excel line by line, as it showed up in LC. In LC 8.1.2 the
> text is pasted with an extra space line between each two lines.
>
> I checked the line ends in both versions. There is only one "LF"
> (byteToNum=10) at the end of each line and it looks the same in both
> versions.
>
> What has changed in LC 8 to cause such a different behavior? Is this again a
> Unicode thing what I don't understand? I already tried different
> clipboarddata keys, without success.
>
> It can't be an Excel option, because I tested it with the same Excel version
> on the same machine.
>
> Any idea, what has to be changed to get the same clipboard result as in LC
> 6?
>
> Thank you
>
> Tiemo
>
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

AW: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
Hi Paul,

I test your approach, but when running the code in the DIE, LiveCode crashes immediatly. When debugging the code, it doesn't crashes, but stops at setting the rawclipboarddata with an error "clipboard is not locked".
This happens anyhow, if I am using "lock clipboard" or not.  I'll file it
Tiemo

-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:[hidden email]] Im Auftrag von Paul Hibbert via use-livecode
Gesendet: Dienstag, 7. Februar 2017 22:11
An: How to use LiveCode <[hidden email]>
Cc: Paul Hibbert <[hidden email]>
Betreff: Re: Different result in LC 6 to LC 8 when copying field text into Excel?

Tiemo,

I’m not sure if this will help because I’m testing on Mac, but I did a little bit of experimenting with the new ‘rawClipboardData’, it allows plain text to be copied out of LC, just to prove it, here’s a button script copied via my now modified Script Buddy plugin…

on mouseUp
   local tClip

   if the selectedText is empty then
      set the clipBoardData["text"] to fld “myTextField"
   else
      copy the selectedText
   end if
   
   if the altKey is down then -- Convert the clipBoard to plain text
      put the clipBoardData["text"] into tClip
      lock the clipBoard
      ## Use some code lifted from the LiveCode Dictionary…
      set the rawClipBoardData to empty -- Clear ALL ClipboardData
      if the platform is "Linux" then set the rawClipboardData["text/plain;charset=utf-8"] \
            to textEncode(tClip, "UTF-8" ) -- Linux
      if the platform is "Win32" then set the rawClipboardData["CF_UNICODE"] \
            to textEncode(tClip, "UTF-16" ) -- Windows
      if the platform is "MacOS" then set the rawClipboardData["public.utf8-plain-text"] \
            to textEncode(tClip, "UTF-8" ) -- OSX
      unlock the clipboard
   end if
end mouseUp

At last, no extra line spacing! :-)

Normally when I paste from LC into Mail I see extra line spacing, and I would have to copy and paste via a plain text editor to remove it. Emptying the clipBoard and setting the rawClipboardData as above seems to work, on Mac at least, hopefully it should work with Excel on Windows too.

Paul




> On Feb 3, 2017, at 6:25 AM, Tiemo Hollmann TB via use-livecode <[hidden email]> wrote:
>
> Can anybody on Windows with LC 8 confirm this:
>
> - create a new stack
> - create a scrolling list field
> - enter three lines of text, each with one word
> - enter into the message box: *set the clipboarddata["text"] to fld 1*
> - open MS Excel (in my case Windows 10, Excel 2013)
> - paste
> - see an extra empty line between each line of text
>
> Pasted in a text editor there are no extra lines and up to LC 7 there
> also was no extra line in Excel.
>
> Can anybody confirm this behavior or even has an idea for a workaround?
>
> Thanks
> Tiemo
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: use-livecode [mailto:[hidden email]] Im
> Auftrag von Tiemo Hollmann TB via use-livecode
> Gesendet: Donnerstag, 2. Februar 2017 12:13
> An: LiveCode User Liste senden <[hidden email]>
> Cc: Tiemo Hollmann TB <[hidden email]>
> Betreff: Different result in LC 6 to LC 8 when copying field text into
> Excel?
>
> Hello,
>
> I have a standard scrolling list field with multiple lines of text. I
> copy the text by:
>
> *set the clipboarddata["text"] to fld "List"*
>
> The User now can past the text into MS Excel on Windows. With LC 6 the
> text was pasted into Excel line by line, as it showed up in LC. In LC
> 8.1.2 the text is pasted with an extra space line between each two lines.
>
> I checked the line ends in both versions. There is only one "LF"
> (byteToNum=10) at the end of each line and it looks the same in both
> versions.
>
> What has changed in LC 8 to cause such a different behavior? Is this
> again a Unicode thing what I don't understand? I already tried
> different clipboarddata keys, without success.
>
> It can't be an Excel option, because I tested it with the same Excel
> version on the same machine.
>
> Any idea, what has to be changed to get the same clipboard result as
> in LC 6?
>
> Thank you
>
> Tiemo
>
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

AW: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
Paul,
I tested a little bit more and this code works for me:
on mouseUp
   lock clipboard
   set the rawClipBoardData to empty
   set the rawClipboardData["CF_UNICODETEXT"] to textEncode(fld 1, "UTF-16" )
   unlock clipboard
end mouseUp

and the IDE doesn't crashes anymore.
BTW. The rawclipboarddata key is supposed to be ["CF_UNICODETEXT"] and not ["CF_UNICODE"] as the docs say.

Thanks for your help
Tiemo


-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:[hidden email]] Im Auftrag von Tiemo Hollmann TB via use-livecode
Gesendet: Mittwoch, 8. Februar 2017 09:33
An: 'How to use LiveCode' <[hidden email]>
Cc: Tiemo Hollmann TB <[hidden email]>
Betreff: AW: Different result in LC 6 to LC 8 when copying field text into Excel?

Hi Paul,

I test your approach, but when running the code in the DIE, LiveCode crashes immediatly. When debugging the code, it doesn't crashes, but stops at setting the rawclipboarddata with an error "clipboard is not locked".
This happens anyhow, if I am using "lock clipboard" or not.  I'll file it Tiemo

-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:[hidden email]] Im Auftrag von Paul Hibbert via use-livecode
Gesendet: Dienstag, 7. Februar 2017 22:11
An: How to use LiveCode <[hidden email]>
Cc: Paul Hibbert <[hidden email]>
Betreff: Re: Different result in LC 6 to LC 8 when copying field text into Excel?

Tiemo,

I’m not sure if this will help because I’m testing on Mac, but I did a little bit of experimenting with the new ‘rawClipboardData’, it allows plain text to be copied out of LC, just to prove it, here’s a button script copied via my now modified Script Buddy plugin…

on mouseUp
   local tClip

   if the selectedText is empty then
      set the clipBoardData["text"] to fld “myTextField"
   else
      copy the selectedText
   end if
   
   if the altKey is down then -- Convert the clipBoard to plain text
      put the clipBoardData["text"] into tClip
      lock the clipBoard
      ## Use some code lifted from the LiveCode Dictionary…
      set the rawClipBoardData to empty -- Clear ALL ClipboardData
      if the platform is "Linux" then set the rawClipboardData["text/plain;charset=utf-8"] \
            to textEncode(tClip, "UTF-8" ) -- Linux
      if the platform is "Win32" then set the rawClipboardData["CF_UNICODE"] \
            to textEncode(tClip, "UTF-16" ) -- Windows
      if the platform is "MacOS" then set the rawClipboardData["public.utf8-plain-text"] \
            to textEncode(tClip, "UTF-8" ) -- OSX
      unlock the clipboard
   end if
end mouseUp

At last, no extra line spacing! :-)

Normally when I paste from LC into Mail I see extra line spacing, and I would have to copy and paste via a plain text editor to remove it. Emptying the clipBoard and setting the rawClipboardData as above seems to work, on Mac at least, hopefully it should work with Excel on Windows too.

Paul




> On Feb 3, 2017, at 6:25 AM, Tiemo Hollmann TB via use-livecode <[hidden email]> wrote:
>
> Can anybody on Windows with LC 8 confirm this:
>
> - create a new stack
> - create a scrolling list field
> - enter three lines of text, each with one word
> - enter into the message box: *set the clipboarddata["text"] to fld 1*
> - open MS Excel (in my case Windows 10, Excel 2013)
> - paste
> - see an extra empty line between each line of text
>
> Pasted in a text editor there are no extra lines and up to LC 7 there
> also was no extra line in Excel.
>
> Can anybody confirm this behavior or even has an idea for a workaround?
>
> Thanks
> Tiemo
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: use-livecode [mailto:[hidden email]] Im
> Auftrag von Tiemo Hollmann TB via use-livecode
> Gesendet: Donnerstag, 2. Februar 2017 12:13
> An: LiveCode User Liste senden <[hidden email]>
> Cc: Tiemo Hollmann TB <[hidden email]>
> Betreff: Different result in LC 6 to LC 8 when copying field text into
> Excel?
>
> Hello,
>
> I have a standard scrolling list field with multiple lines of text. I
> copy the text by:
>
> *set the clipboarddata["text"] to fld "List"*
>
> The User now can past the text into MS Excel on Windows. With LC 6 the
> text was pasted into Excel line by line, as it showed up in LC. In LC
> 8.1.2 the text is pasted with an extra space line between each two lines.
>
> I checked the line ends in both versions. There is only one "LF"
> (byteToNum=10) at the end of each line and it looks the same in both
> versions.
>
> What has changed in LC 8 to cause such a different behavior? Is this
> again a Unicode thing what I don't understand? I already tried
> different clipboarddata keys, without success.
>
> It can't be an Excel option, because I tested it with the same Excel
> version on the same machine.
>
> Any idea, what has to be changed to get the same clipboard result as
> in LC 6?
>
> Thank you
>
> Tiemo
>
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
In reply to this post by JOHN PATTEN via use-livecode
Well any attempt to run the code in the DIE mode would understandably cause anything to crash. ;-)

(sorry I just had to).

Bob S


On Feb 8, 2017, at 24:32 , Tiemo Hollmann TB via use-livecode <[hidden email]<mailto:[hidden email]>> wrote:

but when running the code in the DIE, LiveCode crashes immediatly

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: AW: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
In reply to this post by JOHN PATTEN via use-livecode
Tiemo Hollmann wrote:

 > I tested a little bit more and this code works for me:
 > on mouseUp
 >    lock clipboard
 >    set the rawClipBoardData to empty
 >    set the rawClipboardData["CF_UNICODETEXT"] to textEncode(fld 1,
"UTF-16" )
 >    unlock clipboard
 > end mouseUp
 >
 > and the IDE doesn't crashes anymore.
 > BTW. The rawclipboarddata key is supposed to be ["CF_UNICODETEXT"]
 > and not ["CF_UNICODE"] as the docs say.

I wonder if the difference in keys is because the keys of the
rawClipboardData are platform-specific.

After reading Mark Waddingham's note here last week on a related subject:
http://lists.runrev.com/pipermail/use-livecode/2017-February/234491.html

...I've come to regard the fullClipboardData as my go-to first choice
for manipulating Clipboard contents, resorting to rawClipboardData only
when I need some platform-specific special handling I can't address with
fullClipboardData.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
In reply to this post by JOHN PATTEN via use-livecode
Pleased it helped and thank you for the update.

Paul


> On Feb 8, 2017, at 1:59 AM, Tiemo Hollmann TB via use-livecode <[hidden email]> wrote:
>
> Paul,
> I tested a little bit more and this code works for me:
> on mouseUp
>   lock clipboard
>   set the rawClipBoardData to empty
>   set the rawClipboardData["CF_UNICODETEXT"] to textEncode(fld 1, "UTF-16" )
>   unlock clipboard
> end mouseUp
>
> and the IDE doesn't crashes anymore.
> BTW. The rawclipboarddata key is supposed to be ["CF_UNICODETEXT"] and not ["CF_UNICODE"] as the docs say.
>
> Thanks for your help
> Tiemo
>
>
> -----Ursprüngliche Nachricht-----
> Von: use-livecode [mailto:[hidden email]] Im Auftrag von Tiemo Hollmann TB via use-livecode
> Gesendet: Mittwoch, 8. Februar 2017 09:33
> An: 'How to use LiveCode' <[hidden email]>
> Cc: Tiemo Hollmann TB <[hidden email]>
> Betreff: AW: Different result in LC 6 to LC 8 when copying field text into Excel?
>
> Hi Paul,
>
> I test your approach, but when running the code in the DIE, LiveCode crashes immediatly. When debugging the code, it doesn't crashes, but stops at setting the rawclipboarddata with an error "clipboard is not locked".
> This happens anyhow, if I am using "lock clipboard" or not.  I'll file it Tiemo
>
> -----Ursprüngliche Nachricht-----
> Von: use-livecode [mailto:[hidden email]] Im Auftrag von Paul Hibbert via use-livecode
> Gesendet: Dienstag, 7. Februar 2017 22:11
> An: How to use LiveCode <[hidden email]>
> Cc: Paul Hibbert <[hidden email]>
> Betreff: Re: Different result in LC 6 to LC 8 when copying field text into Excel?
>
> Tiemo,
>
> I’m not sure if this will help because I’m testing on Mac, but I did a little bit of experimenting with the new ‘rawClipboardData’, it allows plain text to be copied out of LC, just to prove it, here’s a button script copied via my now modified Script Buddy plugin…
>
> on mouseUp
>   local tClip
>
>   if the selectedText is empty then
>      set the clipBoardData["text"] to fld “myTextField"
>   else
>      copy the selectedText
>   end if
>
>   if the altKey is down then -- Convert the clipBoard to plain text
>      put the clipBoardData["text"] into tClip
>      lock the clipBoard
>      ## Use some code lifted from the LiveCode Dictionary…
>      set the rawClipBoardData to empty -- Clear ALL ClipboardData
>      if the platform is "Linux" then set the rawClipboardData["text/plain;charset=utf-8"] \
>            to textEncode(tClip, "UTF-8" ) -- Linux
>      if the platform is "Win32" then set the rawClipboardData["CF_UNICODE"] \
>            to textEncode(tClip, "UTF-16" ) -- Windows
>      if the platform is "MacOS" then set the rawClipboardData["public.utf8-plain-text"] \
>            to textEncode(tClip, "UTF-8" ) -- OSX
>      unlock the clipboard
>   end if
> end mouseUp
>
> At last, no extra line spacing! :-)
>
> Normally when I paste from LC into Mail I see extra line spacing, and I would have to copy and paste via a plain text editor to remove it. Emptying the clipBoard and setting the rawClipboardData as above seems to work, on Mac at least, hopefully it should work with Excel on Windows too.
>
> Paul
>
>
>
>
>> On Feb 3, 2017, at 6:25 AM, Tiemo Hollmann TB via use-livecode <[hidden email]> wrote:
>>
>> Can anybody on Windows with LC 8 confirm this:
>>
>> - create a new stack
>> - create a scrolling list field
>> - enter three lines of text, each with one word
>> - enter into the message box: *set the clipboarddata["text"] to fld 1*
>> - open MS Excel (in my case Windows 10, Excel 2013)
>> - paste
>> - see an extra empty line between each line of text
>>
>> Pasted in a text editor there are no extra lines and up to LC 7 there
>> also was no extra line in Excel.
>>
>> Can anybody confirm this behavior or even has an idea for a workaround?
>>
>> Thanks
>> Tiemo
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: use-livecode [mailto:[hidden email]] Im
>> Auftrag von Tiemo Hollmann TB via use-livecode
>> Gesendet: Donnerstag, 2. Februar 2017 12:13
>> An: LiveCode User Liste senden <[hidden email]>
>> Cc: Tiemo Hollmann TB <[hidden email]>
>> Betreff: Different result in LC 6 to LC 8 when copying field text into
>> Excel?
>>
>> Hello,
>>
>> I have a standard scrolling list field with multiple lines of text. I
>> copy the text by:
>>
>> *set the clipboarddata["text"] to fld "List"*
>>
>> The User now can past the text into MS Excel on Windows. With LC 6 the
>> text was pasted into Excel line by line, as it showed up in LC. In LC
>> 8.1.2 the text is pasted with an extra space line between each two lines.
>>
>> I checked the line ends in both versions. There is only one "LF"
>> (byteToNum=10) at the end of each line and it looks the same in both
>> versions.
>>
>> What has changed in LC 8 to cause such a different behavior? Is this
>> again a Unicode thing what I don't understand? I already tried
>> different clipboarddata keys, without success.
>>
>> It can't be an Excel option, because I tested it with the same Excel
>> version on the same machine.
>>
>> Any idea, what has to be changed to get the same clipboard result as
>> in LC 6?
>>
>> Thank you
>>
>> Tiemo
>>
>>
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: AW: Different result in LC 6 to LC 8 when copying field text into Excel?

JOHN PATTEN via use-livecode
In reply to this post by JOHN PATTEN via use-livecode
They are platform-specific - the 'original' win32 ones are here:

<https://msdn.microsoft.com/en-us/library/windows/desktop/ff729168(v=vs.85).aspx>

It looks like Tiemo has discovered a bug in the docs!

Warmest Regards,

Mark.

Sent from my iPhone

> On 8 Feb 2017, at 16:17, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Tiemo Hollmann wrote:
>
> > I tested a little bit more and this code works for me:
> > on mouseUp
> >    lock clipboard
> >    set the rawClipBoardData to empty
> >    set the rawClipboardData["CF_UNICODETEXT"] to textEncode(fld 1, "UTF-16" )
> >    unlock clipboard
> > end mouseUp
> >
> > and the IDE doesn't crashes anymore.
> > BTW. The rawclipboarddata key is supposed to be ["CF_UNICODETEXT"]
> > and not ["CF_UNICODE"] as the docs say.
>
> I wonder if the difference in keys is because the keys of the rawClipboardData are platform-specific.
>
> After reading Mark Waddingham's note here last week on a related subject:
> http://lists.runrev.com/pipermail/use-livecode/2017-February/234491.html
>
> ...I've come to regard the fullClipboardData as my go-to first choice for manipulating Clipboard contents, resorting to rawClipboardData only when I need some platform-specific special handling I can't address with fullClipboardData.
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode