local Dir = win.handlelist("c=TTOTAL_CMD", 1)
local Quote = esc(?+\"+, ?+\+)
local Active = tc.handle
local Source = word(Dir, 1)
local Target
if(Active != Source) do
Source = word(Dir, 2)
Target = word(Dir, 1)
else
Target = word(Dir, 2)
endif
Dir = remove(win.childtextbyindex(Source, 12), -1)
if(not Target) do
Active = "/N " ++ Quote ++ Dir ++ Quote
do("path\TOTALCMD.EXE", Active)
else
tc.cd(Target, Dir)
endif
After executing this script the current path is opened in the next instance of Total Commander. If there is no next instance, then it is run. If there are more instances, they are ignored.