Pasting text and images together

David Epstein dfe4 at cornell.edu
Sat Sep 2 17:07:10 EDT 2023


Paul, getting the keys of the rawClipboardData worked for me too.  What didn’t work was trying to read the values.  See this part of my script, I hope shown this time without the asterisks gMail added before:

   lock clipboard
  …
   put the keys of the rawClipboardData into myK3  ## THIS WORKS
   …
   repeat for each line k in myK3
      try
         put the rawClipboardData[k] into temp[n]  ## DOESN’T WORK
      catch myError
         put myError into e4[n] ## ERROR IS TRIGGERED
      end try
      add 1 to n
   end repeat
   unlock clipboard



> From: Paul Dupuis <paul at researchware.com>
> To: use-livecode at lists.runrev.com
> Subject: Re: Pasting text and images together?
> Message-ID: <3814cd2a-0f20-2bbb-8783-42fc57e68705 at researchware.com>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> 
> Since my method didn't work, I'd try Marks, namely to put the keys of 
> the clipboard array into a variable to look at
> 
> on mouseUp
> ? lock clipboard
> ? put the keys of the clipboarddata into tKeys1
> ? put the keys of the fullclipboarddata into tKeys2
> ? put the keys of the rawclipboarddata into tkeys3
> ? breakpoint
> ? unlock clipboard
> end mouseUp
> 
> I tested this in LC 10dp6 and it works. Once you see what keys are 
> present with your mixed text and images copied to the clipboard, you can 
> choose which clipboard array and keys to work with to get the data.
> 
> -- Paul
> 
> 
>> On 9/2/2023 10:36 AM, David Epstein via use-livecode wrote:
>> Many thanks to Paul Dupuis and Mark Waddingham.  The script below tries to
>> test their suggestions.  Using 10.0.0 dp5 on an Intel Mac, and watching
>> execution after the breakpoint, I get errors at each "try" in the script.
>> So it does not seem that I can write the fullClipboardData
>> or rawClipboardData to an array variable; and it does not seem that I can
>> access any element of the rawClipboardData array.  Further advice is
>> welcome.
>> 
>> Best wishes,
>> David Epstein
>> 
>> *on* a2
>> 
>> *lock* clipboard
>> 
>> *put* the keys of the clipboardData into myK1
>> 
>> *put* the keys of the fullClipboardData into myK2
>> 
>> *put* the keys of the rawClipboardData into myK3
>> 
>> *breakpoint*
>> 
>> *try*
>> 
>> *put* the fullClipboardData into ta2
>> 
>> *catch* myError
>> 
>> *put* myError into e2
>> 
>> *end* *try*
>> 
>> *try*
>> 
>> *put* the rawClipboardData into ta3
>> 
>> *catch* myError
>> 
>> *put* myError into e3
>> 
>> *end* *try*
>> 
>> *put* 1 into n
>> 
>> *repeat* for each line k in myK3
>> 
>> *try*
>> 
>> *put* the rawClipboardData[k] into temp[n]
>> 
>> *catch* myError
>> 
>> *put* myError into e4[n]
>> 
>> *end* *try*
>> 
>> *add* 1 to n
>> 
>> *end* *repeat*
>> 
>> *unlock* clipboard
>> 
>> *end* a2


More information about the use-livecode mailing list