CurDirInNextInstance

Title CurDirInNextInstance
File Name CurDirInNextInstance.txt
Description Open current directory in next instance of Total Commander
Author Vochomurka
Parameters -
Plugins Called win, tc
Icon
Version 1.0
Updated on 23.08.06
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

Comments:

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.


Main Page Total Commander PowerPro