Skip to content

Instantly share code, notes, and snippets.

@samuelcotterall
Created April 5, 2013 15:55
Show Gist options
  • Save samuelcotterall/5320424 to your computer and use it in GitHub Desktop.
Save samuelcotterall/5320424 to your computer and use it in GitHub Desktop.
Sends Compass’ outputted CSS to Transmit’s Docksend
# compass-to-docksend.rb (https://gist.github.com/samuelcotterall/5320424)
#
# Instructions: Put this at the end of config.rb
# Execute AppleScript inside Ruby. I stole this from here: http://porkrind.org/missives/calling-applescript-from-ruby/
def osascript(script)
system 'osascript', *script.split(/\n/).map { |line| ['-e', line] }.flatten
end
# Send to Transmit
on_stylesheet_saved do |filename|
osascript <<-END
ignoring application responses
tell application "Transmit"
open POSIX file "#{filename}"
end tell
end ignoring
END
end
@samuelcotterall
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment