Loading

AutoHotkey 设置在当前文件夹打开TotalCommander

CapsLock & .:: ; total commander
folder := GetActiveExplorerPath()
script := """D:\ProgramFiles\totalcmd\totalcmd.exe"" /R=""" . folder . """"
Run, % script, % folder , Max , ; without folder
Return

GetActiveExplorerPath()
{
	explorerHwnd := WinActive("A")
  if (explorerHwnd)
	{
		for window in ComObjCreate("Shell.Application").Windows
		{
			if (window.hwnd==explorerHwnd)
			{
        folder := window.Document.Folder.Self.Path
				return folder
			}
		}
	}
}
posted @ 2021-10-09 15:20  ZXYFrank  阅读(103)  评论(0编辑  收藏  举报