I'm trying to avoid costly shelling out to pbcopy/pbpaste.
import osproc, strutils
proc pbpaste() : string =
var exitCode: int;
(result, exitCode) = execCmdEx "pbpaste"
proc pbcopy(content: string) =
discard execCmd "echo " & content.replace("\"","\\\"") & "| pbcopy"
if isMainModule:
pbcopy "This is very \"special\""
echo pbpaste()
It see a nimble package:
Nimclipboard which looks to be a wrapper for libclipboard which claims to support _OS X (Cocoa)_
But it doesn't install successfully :-(
Any other suggestions?