pasting clipboard from Excel

Jim Ault jimaultwins at yahoo.com
Tue Sep 13 11:13:11 CDT 2011


On Sep 13, 2011, at 8:37 AM, Colin Holgate wrote:

> Yes, the strange thing is that sometimes it cooperates. It seems to  
> fail more often when copying cells that have a particular data type  
> assigned to them.
>
> Jim, as Craig did too, I'm only attempting to get tab delimited text  
> onto the clipboard. It doesn't matter in any way at all what cells  
> the data came from, or what led to the value of the text. It's also  
> to be a web app as well as multi-platform standalone applications,  
> so AppleScript is out of the question.
>
> Given that it pastes into other programs ok, shouldn't it paste into  
> LiveCode?
Most programs do some sort of conversion/discard of clipboard data  
when they are activated.
Very larger clipboards can make an app seem to hesitate as it activates.

 From my experience, LC tries to give you the clipboard characters  
without much conversion, therefore extra control and high-ascii  
characters can be in the clipboard when you try to work with it (such  
as paste into a field)

Try the following line to see if it makes a difference
put the clipboarddata into tTempVar
delete null in tTempVar
put tTempVar into fld destination
-- nulls do not work with the filter command

or
-- strip the clipboard chars
put the clipboarddata into tTempVar
repeat with K = 1 to 31
     if k is in  " 9 10 13 " then next repeat
    delete char (numtochar(K)) in tTempVar
end repeat
repeat with K = 127 to 255
    delete char (numtochar(K)) in tTempVar
end repeat
put tTempVar into fld destination

Hope this works every time for you.


Jim Ault
Las Vegas





More information about the use-livecode mailing list