Skip to content

Instantly share code, notes, and snippets.

@lkmadushan
Last active August 9, 2018 10:33
Show Gist options
  • Save lkmadushan/da75721a4c1463ae5a9bdb1c149aabc3 to your computer and use it in GitHub Desktop.
Save lkmadushan/da75721a4c1463ae5a9bdb1c149aabc3 to your computer and use it in GitHub Desktop.
Translate English to Sinhala AppleScript (Using Automator in Mac)
on run {input, parameters}
set output to "http://translate.google.com/#auto/si/" & urldecode(input as string)
return output
end run
on urldecode(x)
set cmd to "'require \"cgi\"; puts CGI.escape(STDIN.read.chomp)'"
do shell script "echo " & quoted form of x & " | ruby -e " & cmd
end urldecode
@lkmadushan
Copy link
Author

lkmadushan commented Aug 9, 2018

Installation

  • Open an Automator and create a new Service.
  • From the left column you need to find and grab two functions: Run Apple Script and Website Popup.
  • Copy and Paste code into Apple Script window.

screen shot 2018-08-09 at 3 58 43 pm

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