views:

287

answers:

1

Hi,

I found out how to get the content of the NSPasteboard, and to copy it into my active application. I haven't found a way to paste it into another application, just how to paste it into my current application.

If you're wondering why I would want to do this, I'm researching if there is a way to improve Jumpcut open source application (jumpcut.sf.net). Currently, it fakes Cmd+v to paste the content into another application, but this doesn't work on X11 (which expects Ctrl+v).

Thank you

A: 

The problem is that X11 doesn't really understand the OS X pasteboard at all, so there's some special magic going on to map whatever's on the OS X pasteboard into a form which can be used as the X pasteboard. Depending on what you're prepared to "know" about the target app, you can do something inbetween sending a simulated Ctrl-V event and coercing the app into requesting the content of the clipboard (not the primary clip buffer, which is the middle-click one in X)

Graham Lee