Skip to content

Instantly share code, notes, and snippets.

@tmplinshi
Last active August 29, 2015 14:12
Show Gist options
  • Save tmplinshi/a3bf7066f6cb1f679bf8 to your computer and use it in GitHub Desktop.
Save tmplinshi/a3bf7066f6cb1f679bf8 to your computer and use it in GitHub Desktop.
#c::cmdHere()
cmdHere() {
If WinActive("ahk_class CabinetWClass") || WinActive("ahk_class ExploreWClass")
WinGetText, data
Run, cmd, % RegExMatch(data, "i`am)^地址: \K.*", dir) ? dir : A_Desktop
}
/*
cmdHere() {
If WinActive("ahk_class CabinetWClass") || WinActive("ahk_class ExploreWClass") {
WinHWND := WinActive()
For win in ComObjCreate("Shell.Application").Windows
If (win.HWND = WinHWND) {
dir := SubStr(win.LocationURL, 9) ; remove "file:///"
dir := RegExReplace(dir, "%20", " ")
Break
}
}
Run, cmd, % dir ? dir : A_Desktop
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment