首页 > 其他分享 >autohotkey chrome and edge 有道翻译 收集单词

autohotkey chrome and edge 有道翻译 收集单词

时间:2022-09-29 22:57:52浏览次数:43  
标签:-% exe autohotkey chrome 有道 SendInput 单词 edge

源代码

#IfWinActive ahk_exe msedge.exe
{
    ; 有道查词
    `::searchWord1()
    ; 收集单词
    !`::collectWord()
}
#IfWinActive ahk_exe chrome.exe
{
    ; 有道查词
    `::searchWord2()
    ; 收集单词
    !`::collectWord()
}
searchWord2(){
    Click right
    SendInput, {S}
    SendInput, {Enter}
}

searchWord1(){
    Click right
    SendInput, {Up 3}
    SendInput, {Enter}
}
collectWord(){
    clipboard =  ; 让剪贴板初始为空, 这样可以使用 ClipWait 检测文本什么时候被复制到剪贴板中.
    Send ^c
    ClipWait  
    FileAppend, ===%A_Year%-%A_MM%-%A_DD%-%A_Hour%-%A_Min%-%A_Sec%`n%clipboard% `n`n, %A_ScriptDir%\english_learn_note.txt,UTF-8
    ToolTip, added#
    SetTimer, RemoveToolTip, -1000
    return
    RemoveToolTip:
    ToolTip
    return
}


#y::Suspend

软件

image

标签:-%,exe,autohotkey,chrome,有道,SendInput,单词,edge
From: https://www.cnblogs.com/zhuoss/p/16743400.html

相关文章