Created
March 19, 2014 13:45
-
-
Save benjamintanweihao/9641938 to your computer and use it in GitHub Desktop.
Textmate Copy as RTF
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
#!/usr/bin/env ruby -Ku | |
require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/copy_as_rtf.rb" | |
require "#{ENV['TM_SUPPORT_PATH']}/lib/progress.rb" | |
doc = RtfExporter.new.generate_rtf( STDIN.read ) | |
`echo "hi" | pbcopy` | |
Kernel.open('|pbcopy','w') do |f| | |
f.write(doc) | |
end | |
print doc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment