Stripping styling from the clipboard...

Paul Dupuis paul at researchware.com
Sat Jun 23 19:59:32 EDT 2018


The code below with no spaces between the works is Richmonds

On 6/23/2018 5:58 PM, Tom Glod via use-livecode wrote:
> Paul...may I ask you why your code pasting is the way it is ?...is there
> some kind of practical reason for it being that way?...sure is harder to
> read that way.
>
> On Sat, Jun 23, 2018 at 5:55 PM, Paul Dupuis via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
>> Okay, I missed that in the entry. That explains why the pasteKey message
>> wasn't working.
>>
>> I am all set now. Thank you.
>>
>>
>> On 6/23/2018 5:15 PM, Tore Nilsen via use-livecode wrote:
>>> >From the dictionary:
>>>
>>> The LiveCode development environment traps the pasteKey message <>,
>> unless "Suspend LiveCode UI" is turned on in the Development menu. This
>> means that the pasteKeymessage <> is not received by a stack <> if it's
>> running in the development environment <>.
>>> So if you are trying to do this in the IDE, then that may be the reason
>> it will not work.
>>> Best regards
>>> Tore Nilsen
>>>
>>>> 23. jun. 2018 kl. 22:32 skrev Richmond Mathewson via use-livecode <
>> use-livecode at lists.runrev.com>:
>>>> Hey, Wow, it's the Richmond school of shovels and primitive stuff at
>> its worst.
>>>> If I have a field that conatins some styled text (let's call it "ff1"),
>> and I want to shift it
>>>> with its styling removed into another field (let's call it "ff2") then
>> this does the trick in a button:
>>>> onmouseUp
>>>> gettheplainTextoffld "ff1"
>>>> putit intofld "ff2"
>>>> endmouseUp
>>>>
>>>> and that, oddly enough, might not be a bad place to get started.
>>>>
>>>> ALTHOUGH (ouch) this does NOT work:
>>>>
>>>> onpasteKey
>>>>   gettheplainTextoftheclipboardData
>>>>   putit intofld "ff2"
>>>> endpasteKey
>>>>
>>>> and this does not work:
>>>>
>>>> onpasteKey
>>>>  puttheclipboardDataintofld "ff1"
>>>>  send"mouseUp" tobtn "Button"
>>>> endpasteKey
>>>>
>>>> which would seem to suggest pasteKey is NOT trapping the paste signal
>> at all.
>>>> Richmond.
>>>>
>>>>
>>>> On 23/6/2018 5:15 pm, Paul Dupuis via use-livecode wrote:
>>>>> Using LC9, I want to add a "paste without formatting" (as seen in may
>>>>> browser edit menus) command and I can't see to figure out how to do it.
>>>>>
>>>>> My most recent attempt of many still pastes formatted text (with
>>>>> underlining, bolding, italics, fonts, colors, etc. in place)
>>>>>
>>>>> *on*pasteKey *-- remove formatting*
>>>>> *if* theclipboardData["text"] isnotempty*then*
>>>>> *set*thetextofthetemplateFieldtoclipboardData["text"]
>>>>> *set*theclipboardDatatoempty
>>>>> *set*theclipboardData["text"] totheplaintextofthetemplateField
>>>>> *end* *if*
>>>>> *paste*
>>>>> *end*pasteKey
>>>>>
>>>>> Maybe I just haven't had enough Caffeine yet?
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>> _______________________________________________
>>>> 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
>>> _______________________________________________
>>> 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
>>>
>>
>> _______________________________________________
>> 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
>>
> _______________________________________________
> 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