No ok, mozno nie jednoduchsi, ale urcite zabavnejsi a funkcnejsi:

Code: Select all
~$F7::
WinWait, Total Commander ahk_class TCOMBOINPUT
WinWaitClose, Total Commander ahk_class TCOMBOINPUT
WinWait, Total Commander ahk_class #32770, , 2
IfEqual, ErrorLevel, 0
{
WinText =
FoundPos =
DirName1 =
TCWindowText =
TCPath =
WinGetText, WinText
FoundPos := RegExMatch(WinText, "OK\r\nError: Directory \[(.*)\]\ralready exists!\rPlease specify a different name\.", DirName)
IfEqual, FoundPos, 0
Return
; WinClose
; Uncomment the line above to suppress the error message that the directory already exists
WinWaitActive, ahk_class TTOTAL_CMD
WinGetText, TCWindowText
Loop, Parse, TCWindowText, `n, `r
If (SubStr(A_LoopField, 0) = ">")
{
StringTrimRight, TCPath, A_LoopField, 1
Break
}
Dir = %TCPath%\%DirName1%`r
VarSetCapacity(CopyDataStruct, 12, 0)
NumPut(Asc("C"), CopyDataStruct, 0)
NumPut(Asc("D"), CopyDataStruct, 1)
NumPut(StrLen(Dir)+4, CopyDataStruct, 4)
NumPut(&Dir, CopyDataStruct, 8)
NumPut(Asc("S"), Dir, StrLen(Dir) + 1)
SendMessage, 0x4A, 0, &CopyDataStruct,, ahk_class TTOTAL_CMD
VarSetCapacity(CopyDataStruct, 0)
}
Return
Roman