cannot copy rawdata to the clipboard

Hi everyone,

I tried to copy some rawdata into the clipboard using the code below.

[code] Dim c As New Clipboard
c.SetText mDate.SQLDateTime

Dim s As String = mDate.SQLDateTime
Dim mb As MemoryBlock
mb = s
c.AddRawData mb, “myclipdata”
c.Close
[/code]

this code is in the editcopy menu handler.
I want to copy the mDate as an sqldate in the clipboard
the text gets copied to the clipboard, but the rawdata gets only the data type entry in the clipboard, and zero data.
I used clipboardviewer to check that.
I also tried : c.AddRawData s, "myclipdata" -> same result.

what did I do wrong ?
thanks.

Xojo 2017r3 - MacOS 10.11.6

From the docs:

how can I copy completely pure private row data that does not belong to any UTI ?

in fact I think I will it like that. this rawdata not in UTI will serve as a flag to me, telling that the data in the clipboard has been made by my app, then I can use the text data.
thanks Greg.

As you are on macOS, you can use the AppleScript’s Script Editor (Éditeur de Script) using:

return clipboard info

to get information of what you have in the Clipboard and add class “” to get the information for the specific class (you saw in the previous command).

Apple Link: clipboard info

In a project, I allow Copy and Paste of what is on screen (TextFields and one Canvas).

return clipboard info

gave me:

{{«class utf8», 66}, {TIFF picture, 390316}, {«class ut16», 134}, {string, 66}, {Unicode text, 132}, {«class 8BPS», 348874}, {GIF picture, 68555}, {«class jp2 », 27948}, {JPEG picture, 30017}, {«class PNGf», 194756}, {«class BMP », 388502}, {«class TPIC», 364699}}

And:

return clipboard info for JPEG picture
{{JPEG picture, 30017}}

Sorry: I totally forgot (and not found after an extensive search) how to get that particular contents (ie the text in Unicode text for example).

No need to download or run larger application.
HTH.

Emile, ClipboardViewer is a very nice free tool to see all the clipboard content.

https://developer.apple.com/library/content/samplecode/ClipboardViewer/Introduction/Intro.html