Skip to content

Instantly share code, notes, and snippets.

@benjamintanweihao
Created March 19, 2014 13:45
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 benjamintanweihao/9641938 to your computer and use it in GitHub Desktop.
Save benjamintanweihao/9641938 to your computer and use it in GitHub Desktop.
Textmate Copy as RTF
#!/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