aboutsummaryrefslogtreecommitdiff
path: root/tt.jump.ahk
diff options
context:
space:
mode:
Diffstat (limited to 'tt.jump.ahk')
-rw-r--r--tt.jump.ahk20
1 files changed, 13 insertions, 7 deletions
diff --git a/tt.jump.ahk b/tt.jump.ahk
index aa5232f..f1e62c1 100644
--- a/tt.jump.ahk
+++ b/tt.jump.ahk
@@ -15,20 +15,15 @@ JumpPaths := { s: env("Sync")
#s::
ToolTip, ...
-SendInput, {Blind}{LWin Up}{RWin Up}
-Input, k, C L1
+Input, k, M C L1
if (JumpPaths[k] != "")
{
if (InStr(FileExist(JumpPaths[k]), "D"))
- Run, % "explorer /n, """ JumpPaths[k] """"
+ OpenExplorer(JumpPaths[k])
else
Run, % """" JumpPaths[k] """"
}
ToolTip
-if (GetKeyState("LWin", "P"))
- SendInput, {Blind}{LWin Down}
-if (GetKeyState("RWin", "P"))
- SendInput, {Blind}{RWin Down}
return
;; -> library
@@ -38,3 +33,14 @@ env(name)
EnvGet, r, %name%
return r
}
+
+OpenExplorer(path)
+{
+ for window in ComObjCreate("Shell.Application").Windows {
+ if (window.Document.Folder.Self.path = path) {
+ WinActivate, % "ahk_id " window.hwnd
+ return
+ }
+ }
+ Run, % "explorer /n, """ path """"
+}