Тема: AHK:Открыть выделенную папку средней кнопкой мыши
Доброго времени суток. Есть скрипт на открытие средней кнопкой мыши файла с расширением "ahk", как бы туда добавить ещё открытие папки.
~*$vk4::
Sleep, 60
Click
WinClose ahk_class #32768 ahk_exe explorer.exe
If (path := Explorer_GetSel()) && (RegExMatch(path, "i)\.ahk$"))
Run C:\Program Files (x86)\AkelPad\AkelPad.exe %path%
Else
SendInput % "{" A_ThisHotkey "}"
Double:
Double := 0
return
#If
Explorer_GetSel()
{
if !(window := Explorer_GetWindow())
return ""
if (window="desktop")
{
ControlGet, hwWindow, HWND,, SysListView321, ahk_class Progman
if !hwWindow
ControlGet, hwWindow, HWND,, SysListView321, A
ControlGet, files, List, % "Selected Col1",, ahk_id %hwWindow%
base := SubStr(A_Desktop,0,1)=="\" ? SubStr(A_Desktop,1,-1) : A_Desktop
Loop, Parse, files, `n, `r
{
path := base "\" A_LoopField
IfExist %path%
ret .= path "`n"
}
}
else
{
collection := window.document.SelectedItems
for item in collection
ret .= item.path "`n"
}
return Trim(ret,"`n")
}
Explorer_GetWindow()
{
WinGetClass class, % "ahk_id" hwnd := WinExist("A")
if (class ~= "(Cabinet|Explore)WClass")
{
for window in ComObjCreate("Shell.Application").Windows
if (window.hwnd==hwnd)
return window
}
else if (class ~= "Progman|WorkerW")
return "desktop"
}
return