Lukasz Dorosz有一篇文章 ( https://medium.com/@mrdoro/fast-translation-with-google-translator-and-mac-osx-817e32233b7a ) 关于使用 Apple Automator 将 Google 翻译器与 macOS 集成。我做到了,它有效。我的问题是 - 如何将 DeepL 翻译器与 macOS 集成?
使用 Automator,您可以通过几个步骤将 Goole Translator 与 macOS 集成:
打开 Automator 并创建一个新服务。顶部这样设置:从左栏中你需要找到并抓住两个功能:运行>Apple Script和网站弹出。将此代码复制并粘贴到 Apple 脚本窗口中。
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
如何更改脚本以使用来自 DeepL 而不是 Google 的翻译器?