MBS Clipboard - How to use?

I want to get a picture from the system clipboard. I don’t see that this is possible with Xojo without using declares, so I turn to MBS. This code

[code]dim p As Picture

p = MBS(“Clipboard.GetPicture”)[/code]

results in a “This method requires fewer parameters than were passed” error.

According to MBS docs, the signature is

MBS( "Clipboard.GetPicture" { ; ImageType; Filename } )

and it returns an image. What am I doing wrong?

What is so special about the MBS clipboard as opposed to the Xojo one?

dim p as picture
Dim c As New Clipboard
If c.PictureAvailable Then  p=c.picture
c.Close

there is no need for declares

I want to access the system clipboard, not a new clipboard that I instantiate. Does your code do that?

That is EXACTLY what that code does… “NEW CLIPBOARD” just creates a connection to the system clipboard…

Awesome, thanks! :slight_smile:

Sorry, but you looked on our documentation for the MBS FileMaker Plugin instead of the Xojo one.

And MBS Plugins provide classes for clipboard on Mac and Windows which do more than the build in clipboard class…

See
http://www.monkeybreadsoftware.net/class-nspasteboardmbs.shtml
And
http://www.monkeybreadsoftware.net/class-windowsclipboardmbs.shtml

From experience I know that if possible you should use his clipboard plugin rather than the xojo way.
The xojo clipboard object doesnt alleays store data in a format you expect. Tried to solve it a while ago but gave up when Christian came with a working solution quite quick aftwr my request. Now it’s in his compete-set.