quark-shell-mac icon indicating copy to clipboard operation
quark-shell-mac copied to clipboard

Clipboard API

Open acketon opened this issue 10 years ago • 2 comments

Could you add a simple copy to clipboard api? Since all of the content is in a web view I can't find a way to use Javascript to copy text/etc to the clipboard.

Node Webkit has a clipboard api that seems to work well: https://github.com/rogerwang/node-webkit/wiki/Clipboard

https://github.com/rogerwang/node-webkit/tree/897288eac99ca9895bf209367a9526be67579f1f/src/api/clipboard

Thanks

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3435202-clipboard-api?utm_campaign=plugin&utm_content=tracker%2F899498&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F899498&utm_medium=issues&utm_source=github).

acketon avatar Aug 01 '14 04:08 acketon

I added this pasteboard example I found on stack overflow, but I don't really understand it. It works and I tied it to a mw.copyString() that I based off the openURL() function

-(void)copyString:(NSString*)str { NSPasteboard *pb = [NSPasteboard generalPasteboard]; NSArray *types = [NSArray arrayWithObjects:NSStringPboardType, nil]; [pb declareTypes:types owner:self]; [pb setString: str forType:NSStringPboardType]; }

acketon avatar Aug 02 '14 05:08 acketon

You can try using https://github.com/styfle/copee

styfle avatar Jun 06 '18 13:06 styfle