Skip to content

Instantly share code, notes, and snippets.

@sma
Created August 12, 2009 08:07
Show Gist options
  • Save sma/166384 to your computer and use it in GitHub Desktop.
Save sma/166384 to your computer and use it in GitHub Desktop.
# shell script to copy styled text from textmate to keynote
# input: selected text or document, output: discard, key: ctrl+alt+cmd+C
ruby -e'
require "jcode"
$KCODE="U"
require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/doctohtml.rb"
require "#{ENV["TM_SUPPORT_PATH"]}/lib/progress.rb"
unit = ENV.has_key?("TM_SELECTED_TEXT") ? "selection" : "document"
TextMate.call_with_progress(:message => "Creating HTML version of #{unit}…") do
print document_to_html( STDIN.read, :include_css => true )
end'|sed 's/font-size: [0-9][0-9]*px/font-size: 24px/'|textutil -convert rtf -stdin -stdout|pbcopy
echo 'Done!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment