Skip to content

Instantly share code, notes, and snippets.

@roder
Forked from defunkt/pbcopy.rb
Created August 18, 2010 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roder/533563 to your computer and use it in GitHub Desktop.
Save roder/533563 to your computer and use it in GitHub Desktop.
def pbcopy(string)
pasteBoard = NSPasteboard.generalPasteboard
pasteBoard.declareTypes([NSStringPboardType], owner: nil)
pasteBoard.setString(string, forType: NSStringPboardType)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment