Pasting text and images together

David Epstein dfe4 at cornell.edu
Mon Sep 4 15:36:13 EDT 2023


I do not know how my problems accessing the rawClipboardData were overcome, but I succeeded in reading the array values there.  So I was able to address my original question of how to reconstruct in LiveCode a combination of text and image copied from another program.  Conclusion thus far:  no success.  If anyone is interested in this and might have some further suggestions, read on.

When I use the control key to invoke from the contextual menu “copy image” on a web page, the fullClipboardData[“image”] gets a string of humanly unintelligible characters that, when used as the text of a LiveCode image object, shows the copied image.   I did this for the picture of Robert Cailliau on webpage https://livecode.com/core-benefits-of-livecode/.  Call this String A.

To see how this information might be stored when I have copied both text and image, I selected from the word before to the word after that same picture, chose “Copy,” and then inspected the rawClipboardData["com.apple.flat-rtfd”], which seemed the most promising candidate of the various clipboardData array values.  Call this String B.

Something that looks kind of like String A appears in String B, but it is not the same.

At char 4097 of String B I see the first few characters of the beginning of String A, and think this might define the PNG data to follow.  But what follows is not the same as String A.

Here’s the start of string A:

âPNG
IHDR,,y}éusRGBÆŒÈDeXIfMM*ái††,†,ÿ`ÇÁ@IDATxÏΩ

And here’s char 4097ff of String B;

âPNG
IHDR,,y}éu IDATxúÏΩ{¨mYv÷˜sƵˆ„ÏÛ∏˜ú{Îvuuwuπ‹.€Ìˆ«!,d«2$qä¯a«9éCj,d°!dÅ"EâàB 

So my hope that String A could somehow be extracted from String B and used to “paste” the included image was disappointed. 

David Epstein


More information about the use-livecode mailing list