DonationCoder.com Software > Post New Requests Here
DONE: ESC closes Windows Explorer (AHK)
(1/1)
brotherS:
Hi!
I came up with this little script to easily close Windows Explorer windows:
--- ---#Persistent
$ESC::
Send, {ESC}
If WinActive("ahk_class ExploreWClass")
Send !{F4}
return
It works great, it just has one problem: you can't use ESC anymore to abort renaming of files, like when you accidentally deleted important parts of the file name and can't just press enter to "OK" the change.
So I need some way to 'only send Alt+F4 (!{F4}) if ESC is pressed twice within one second'. Got any ideas for a smart solution? I bet you do!
:Thmbsup:
jgpaiva:
Something in this terms might solve it:
--- ---ESCflag := false
$ESC:
Send,{ESC}
IF WinActive("ahk_class ExploreWClass")
IF ESCflag
send,!{F4}
else
{
ESCflag := True
settimer,SomeTimer,1000
}
return
SomeTimer:
settimer,SomeTimer,off
ESCflag := false
return
Warning: untested code. But should work ;)
kimmchii:
i use this:
--- ---Opt("WinTitleMatchMode", 4)
while WinExists("classname=CabinetWClass", "")
Winclose("classname=CabinetWClass", "")
wendedit: unrelated code, sorry lol.
brotherS:
Thanks jgpaiva, works! :up:
kimmchii: what does that do: close *all* Windows Explorer windows?
kimmchii:
yes, close *all* Windows Explorer :D
Navigation
[0] Message Index
Go to full version