Created
December 10, 2009 13:00
-
-
Save yoko/253316 to your computer and use it in GitHub Desktop.
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
on url_encode(str) | |
set ret to do shell script "ruby -e \"require 'uri'; print URI.encode('" & str & "', Regexp.new(\\\"[^#{URI::PATTERN::UNRESERVED}]\\\"))\"" | |
return ret | |
end url_encode | |
tell application "BathyScaphe" | |
set _text to selected text of document 1 | |
set _title to title of document 1 | |
set _url to URL of document 1 | |
end tell | |
set _text to url_encode(_text) | |
set _title to url_encode(_title) | |
set _url to url_encode(_url) | |
tell application "Safari" | |
activate | |
set _tumblr to "http://www.tumblr.com/share?v=3&u=" & _url & "&t=" & _title & "&s=" & _text | |
open location _tumblr | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment