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() Run
It see a **nimble** package: [Nimclipboard](https://github.com/genotrance/nimclipboard) which looks to be a wrapper for [libclipboard](https://github.com/jtanx/libclipboard) which claims to support _OS X (Cocoa)_ But it doesn't install successfully :-( Any other suggestions?