public
Description: Copy as RTF - a TextMate bundle to make copying syntax highlighted text into Keynote, etc easy peasy
Homepage: http://macromates.com
Clone URL: git://github.com/drnic/copy-as-rtf-tmbundle.git
Search Repo:
copy-as-rtf-tmbundle / Commands / Copy as RTF.tmCommand
100644 29 lines (28 sloc) 0.786 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>command</key>
  <string>#!/usr/bin/env ruby -rjcode -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 )
Kernel.open('|pbcopy','w+') do |f|
  f.write(doc)
end
print doc
</string>
  <key>input</key>
  <string>selection</string>
  <key>inputFormat</key>
  <string>xml</string>
  <key>keyEquivalent</key>
  <string>^~@r</string>
  <key>name</key>
  <string>Copy as RTF</string>
  <key>output</key>
  <string>discard</string>
  <key>uuid</key>
  <string>6F9D791B-B8E5-456D-A574-1B5C71F232FF</string>
</dict>
</plist>