Ms word 自动热键脚本,右键单击并在Word中保存图像

Ms word 自动热键脚本,右键单击并在Word中保存图像,ms-word,autohotkey,hotkeys,Ms Word,Autohotkey,Hotkeys,我正在尝试制作一个脚本,允许我右键单击图像,并使用上下文菜单将其保存为默认位置的图像,并使用Word选择的默认图像名称。我试图将(右键单击->按钮按下->回车)序列简化为一个Ctrl+RClick组合 这是我现在拥有的,但不起作用: ^RButton:: MouseClick, right Sleep, 500 Send, s Sleep, 500 Send, {Enter} return 如果我做了一些愚蠢的事情,请道歉,我今天才开始使用ahk。试试看 #IfWinActive ahk_


我正在尝试制作一个脚本,允许我右键单击图像,并使用上下文菜单将其保存为默认位置的图像,并使用Word选择的默认图像名称。我试图将(右键单击->按钮按下->回车)序列简化为一个Ctrl+RClick组合



这是我现在拥有的,但不起作用:

^RButton::
MouseClick, right
Sleep, 500
Send, s
Sleep, 500
Send, {Enter}
return
如果我做了一些愚蠢的事情,请道歉,我今天才开始使用ahk。

试试看

#IfWinActive ahk_exe WINWORD.EXE ; only if MS Word is the active window

    ^RButton::
        KeyWait, Ctrl, L ; wait for the Control key to be released
        Click right
        WinWait, ahk_class Net UI Tool Window ; Word's context menu
        WinActivate, ahk_class Net UI Tool Window
        WinWaitActive, ahk_class Net UI Tool Window
        Send, s
        WinWait, Save As Picture
        WinActivate, Save As Picture
        WinWaitActive, Save As Picture
        Send, {Enter}
    return

#IfWinActive