xiaoka
V2EX  ›  问与答

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

  •  
  •   xiaoka · Aug 6, 2023 · 1547 views
    This topic created in 1037 days ago, the information mentioned may be changed or developed.
    每次手动点击搜索栏的翻译都很费劲,safari 有没有快捷键或者通过 appscript 脚本进行操作可以启用网页翻译?
    iOCZ
        1
    iOCZ  
       Aug 6, 2023
    appscript gui
    iOCZ
        2
    iOCZ  
       Aug 6, 2023   ❤️ 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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3771 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 10:28 · PVG 18:28 · LAX 03:28 · JFK 06:28
    ♥ Do have faith in what you're doing.