Created
June 22, 2010 17:44
-
-
Save defunkt/448806 to your computer and use it in GitHub Desktop.
Copy a string to the pasteboard in MacRuby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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