V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
xiaoka
V2EX  ›  问与答

safari 如何通过快捷键启用网页翻译?

  •  
  •   xiaoka · 266 天前 · 522 次点击
    这是一个创建于 266 天前的主题,其中的信息可能已经有所发展或是发生改变。
    每次手动点击搜索栏的翻译都很费劲,safari 有没有快捷键或者通过 appscript 脚本进行操作可以启用网页翻译?
    iOCZ
        1
    iOCZ  
       266 天前
    appscript gui
    iOCZ
        2
    iOCZ  
       266 天前   ❤️ 1
    tell application "System Events"
    tell application process "Safari"
    tell menu bar 1
    tell menu bar item "显示"
    tell menu 1
    tell menu item "翻译"
    tell menu 1
    #翻译为中文
    if enabled of menu item 1 is true then
    tell menu item 1
    click
    end tell
    #翻译为英文
    else if enabled of menu item 2 is true then
    tell menu item 2
    click
    end tell
    else
    #显示原始网页
    if enabled of menu item 5 is true then
    tell menu item 5
    click
    end tell
    end if
    end if
    end tell
    end tell
    end tell
    end tell
    end tell
    end tell
    end tell
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5770 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 02:43 · PVG 10:43 · LAX 19:43 · JFK 22:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.