简体   繁体   中英

I am trying to extract a folder using 7-zip and AutoHotKey, but the script only opens the zipped folder in a new window

Right-clicking on a zipped folder, pressing 7 (selects the 7-zip sub-menu), pressing e three times, and then pressing enter extracts the folder. I tried to automate this, but it just opens the zipped folder in a new window:

#IfWinActive, AHK_EXE Explorer.exe
^e::
blockinput on
SetKeyDelay, 5000
send {RButton}
SetKeyDelay, 5000
send 7
SetKeyDelay, 5000
send e
SetKeyDelay, 5000
send e
SetKeyDelay, 5000
send e
SetKeyDelay, 5000
send {enter}
blockinput Off
return

First of all, SetKeyDelay only needs to be called once. Maybe you meant to use Sleep .

I got it working without SetKeyDelay and without needing to have the cursor over the file, because I used the "menu" key instead of a right-click. Hope this helps.

BlockInput Send

#IfWinActive, ahk_exe Explorer.exe
^e::
  Send {AppsKey}7eee{Enter}
  Return

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM