;AHKVersion: Unicode 64bit v2.0 a077 ;Author: fuwt ;date: 2017-01-25 ;2017-02-20T19:47:18: 增加聚焦功能 SetWorkingDir, %A_ScriptDir% global Items := [] global dic := {} ;注册热键 Hotkey, if, WinActive("ahk_class CabinetWClass") && A_CaretX = "" loop(26){ thisHotkey := Chr(A_Index + 96) ToolTip, % Hotkey Hotkey, %thisHotkey%, QuickSearch } Hotkey, %A_Space%, QuickSearch ;创建字典 LoopRead("dic"){ line := StrSplit(A_LoopReadLine, A_Tab) key := line[1] value := line[2] dic[key] .= value } return #If WinActive("ahk_class CabinetWClass") && A_CaretX = "" ~Enter:: esc:: Hotkeys := "" ToolTip return Backspace:: Hotkeys := SubStr(Hotkeys, 1, StrLen(Hotkeys) - 1) ToolTip, % Hotkeys return QuickSearch: Matched := "" Hotkeys := Hotkeys . A_ThisHotkey ToolTip, % Hotkeys ControlGetText, Path, ToolbarWindow323, A Path := getPath() folder := ComObjCreate("shell.Application").NameSpace(Path) items := folder.Items for item in items{ if MatchStr(item.name, Hotkeys){ Matched .= item.name . "`n" ;ToolTip % hotkeys "`n" Matched SelectItem(item.name) break } } return MatchStr(str, chrs){ ismatch := 1 if InStr(chrs, A_Space){ LoopParse(chrs,A_Space){ ismatch *= RegExMatch(StrToChr(str), "i)" . A_LoopField) } return ismatch } else{ return RegExMatch(StrToChr(str), "i)^" . chrs) } } StrToChr(name){ thisChr := "" LoopParse(name){ if dic[A_LoopField] thisChr := thisChr . dic[A_LoopField] else thisChr := thisChr . A_LoopField } return thisChr } getPath(){ thisHwnd := WinGetID("A") ProcessName := WinGetProcessName("A") class := WinGetClass("A") if ProcessName!="explorer.exe" return for window in ComObjCreate("Shell.Application").Windows { if window.name = "文件资源管理器" && window.hwnd == thisHwnd path := StrReplace(window.LocationURL, "file:///", "") path := StrReplace(path, "/", "\") path := StrReplace(path, "`%20"," ") } return path } SelectItem(argv){ hwnd := WinActive("a") Windows := ComObjCreate("shell.Application").Windows for window in Windows{ if window.hwnd == hwnd thisWindow := window } folder := thisWindow.document.folder for item in folder.items if item.name == argv thisWindow.document.SelectItem(item, 13) }
[su_highlight]源码为ahk V2版本,已打包编译(含码表文件)[/su_highlight]
http://pan.baidu.com/s/1i452lyl
亲爱的朋友们,如果你认为本站不错请打赏,我们非常感谢你的支持!
[su_button url=”http://www.autoahk.com/buyamoney” style=”3d” color=”#ffe41c” size=”20″ radius=”round”]赏[/su_button]
1.1版本会更好!
v2版本人用的少
我的自用脚本已经全转v2,感觉函数式的输入一些… 懒得写1.1的了。 都会编译后再上传
嗯嗯 可以毕竟 2.0是未来
为啥下载到百度盘的 也一样报错?
字母敲击完了,屏上也出提示了,怎么定位到文件上呢?
好东西,我来仿制个V1的