Created
January 18, 2017 23:56
-
-
Save eruffaldi/6df8e5ca2b6a50a0e4528d748992a77c to your computer and use it in GitHub Desktop.
pbpaste html OSX
This file contains 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
// xcrun -sdk macosx swiftc pbpaste.swift -o pbpaste-html | |
// from: http://stackoverflow.com/questions/17217450/how-to-get-html-data-out-of-of-the-os-x-pasteboard-clipboard | |
import Cocoa | |
let type = NSPasteboardTypeHTML // PNG for image | |
if let string = NSPasteboard.generalPasteboard().stringForType(type) { | |
print(string) | |
} | |
else { | |
print("Could not find string data of type '\(type)' on the system pasteboard") | |
exit(1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment