【发布时间】:2014-12-24 15:36:55
【问题描述】:
我在 Applescript 中制作了一个快速翻译应用程序,它将剪贴板上的任何内容放入 Google 翻译中。它适用于基本的 A-Z 和一些符号。如果应用程序无法识别该字符,它只会写入“a”。我需要它来支持非拉丁字符,如日语和符号。我尝试在第 2 行的末尾添加“作为 Unicode 文本”,但这不起作用。
get the clipboard
set translateMe to the clipboard as Unicode text
tell application "Safari"
activate
end tell
tell application "Safari"
activate
open location "https://translate.google.com"
end tell
delay 1
tell application "System Events"
keystroke translateMe
end tell
【问题讨论】:
标签: macos applescript translation