'un-style' clipboard text...

Richard Gaskin ambassador at fourthworld.com
Tue Mar 2 11:23:21 EST 2004


J. Landman Gay wrote:

> On 3/2/04 2:12 AM, Chipp Walters wrote:
> 
>> Hi Jeanne, Jan -- me again :-)
>>
>> Turns out my RR2.1.2 was hosed. Reinstalled and now this works for me.
>>
>> on pasteIt
>>   put the selectedChunk into tChunk
>>   if tChunk is empty then exit to top
>>   if the clipboard is text then
>>     put the clipboardData["text"] into tTxt
>>     put "put tTxt into " & tChunk into tDo
>>     do tDo
>>   end if
>> end pasteIt
>>
>>
>> This will effectively paste styled text w/out the style into a fld,
>> replacing the selected text.
> 
> 
> This does too:
> 
>   set the textstyle of the selection to "plain"
> 
> It is both shorter and retains the selection and the scroll. No need to 
> save and re-select.

Since this is happening in a paste operation, wouldn't you need to first 
get the offset to the beginning of the selection, count the length of 
the clipboard contents, and set the selection accordingly before running 
that line?

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com


More information about the use-livecode mailing list