【问题标题】:Applescript and Non-English CharactersApplescript 和非英文字符
【发布时间】: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


    【解决方案1】:

    您可以像这样使用 URL 语法:

    tell application "Safari"
        activate
        open location "https://translate.google.com/#auto/en/" & (the clipboard)
    end tell
    

    【讨论】:

      猜你喜欢
      • 2020-09-26
      • 1970-01-01
      • 2016-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多