Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I set up an Automator Service that receives selected text and then runs a simple shell script to pass the text to open google translate:

open https://translate.google.com/#auto/en/"$@"

It opens google translate just fine, but doesn't pass the text along with it. How can I fix?

google translate service

share|improve this question
add comment

1 Answer

It worked for me as long as pass input was set to as arguments. You could try restarting or creating a new identical service like that.

You have to URL encode the input though:

open https://translate.google.com/#auto/auto/$(ruby -rcgi -e 'print CGI.escape(STDIN.read)')

Or if you don't want to use ruby:

xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g'
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.