def sendToClipBoard(string): from AppKit import NSPasteboard,NSObject,NSStringPboardType pasteboard = NSPasteboard.generalPasteboard() emptyOwner = NSObject.alloc().init() pasteboard.declareTypes_owner_([NSStringPboardType], emptyOwner) pasteboard.setString_forType_(string, NSStringPboardType) if __name__ == "__main__": import sys sendToClipBoard(sys.stdin.read())
Idea from this marvellous post about writing a SIMBL plugin in Python.
About the building the TabDump plugin:
When I built the SIMBL plugin, I had to compile it with
/usr/bin/python setup.py py2app
and I had to set MaxBundleVersion='6531' in setup.py
Anothere way is to build it with
/usr/bin/python setup.py py2app -s --site-packages
It doesn't copy in 16 MB python stuff into the bundle.
For some reason /opt/local/bin/python doesn't work, because
then py2app makes only a i368 binary, not a x86_64 binary. Weird.