Forcing 'paste' to paste plain text

Graham Samuel livfoss at mac.com
Thu May 7 16:25:46 EDT 2015


Thanks to all who replied. I love Roger’s latest - it appears then that even if the clipboard contains styled text, that one command will lose the styling. That’s really what I wanted. Richmond’s solution only works if one programs the actual ‘paste’ - knowing what one is pasting into - but as I should have explained, I want the engine to simply execute the ‘paste’ command for me, so I don’t have to mess with fields and selections. This works very well in an ‘Edit’ menu for example: so do ‘copy’ and ‘cut’. It’s just that I found that if the text happened to be styled, it ended up like that in a field which didn’t expect it, and I didn’t want to give the user a function for making the text plain - not appropriate in the app I’m doing.

Graham

> On 6 May 2015, at 18:47, Roger Eller <roger.e.eller at sealedair.com> wrote:
> 
> Even better, you can paste into any field, whether inside or outside of
> LiveCode:
> 
> on mouseUp
> 
>   set the clipboardData["text"] to the clipboardData["text"]
> 
> end mouseUp
> 
> 
> 
> On Wed, May 6, 2015 at 12:38 PM, Peter Brigham <pmbrig at gmail.com> wrote:
> 
>> Try this:
>>   put the clipboarddata["text"] into the selection
>> 
>> -- Peter
>> 
>> Peter M. Brigham
>> pmbrig at gmail.com
>> http://home.comcast.net/~pmbrig
>> 
>> 
>> 
>> On Wed, May 6, 2015 at 12:00 PM, Graham Samuel <livfoss at mac.com> wrote:
>> 
>>> I want to make sure that any text pasted by my ‘paste’ menu gets pasted
>> as
>>> plain (unstyled) text whether or not it is styled to start with.
>> Probably a
>>> dumb question but I can’t quite see how to do this with ‘the
>>> clipboardData’. Can anyone suggest how this should be done?
>>> 
>>> TIA
>>> 
>>> Graham
>> 
>> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list