There is an article (https://medium.com/@mrdoro/fast-translation-with-google-translator-and-mac-osx-817e32233b7a) from Lukasz Dorosz about using Apple Automator to integrate Google translator with macOS. I did it and it works. My question is - How can I integrate DeepL translator with macOS?
Using Automator you can integrate a Goole Translator with macOS in few steps:
Open an Automator and create a new Service. The top section set in this way: From the left column you need to find and grab two functions: Run >Apple Script and Website Popup. Copy and Paste this code into Apple Script window.
on run {input, parameters}
set output to "http://translate.google.com/translate_t?sl=auto&tl=ru&text=" & 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
How do I change the script to use the translator from DeepL instead of Google?