MultiCopy

Title MultiCopy
File Name MultiCopy.txt
Description Copies files to all directories represented by target panel tabs
Author Vochomurka
Parameters ("%L")
Plugins Called win, file, vec
Icon
Version 3.0
Updated on 20.08.17
;;If wincmd.ini is not in Windows directory, indicate its path implicitly: 
global Config = env("WINDIR") ++ "/wincmd.ini"
local hwnd = win.handle("c=TTOTAL_CMD")
local i, j, T, Target, Panel, Opp
global TT = cl.Create("Tabs", 1)
win.sendmessage(hwnd, 0x400+51, 580, 0)

if(win.sendmessage(hwnd, 0x400+50, 1000, 0) == 1) do
;Sub_ReadTabs - name of script ReadTabs
	T = runfile.Subs\Sub_ReadTabs("right")
	Opp = 2
else
	T = runfile.Subs\Sub_ReadTabs("left")
	Opp = 1
endif

if(T == 1) do
	win.sendmessage(hwnd, 0x400+51, 3101, 0)
	quit
endif

local Str = file.readall(arg(1))

local v = vec.createfromlines(Str)
if(v <= 0) do
	messagebox("ok error", "Vector not created", "VEC plugin error #1")
	quit
endif

local Counter = vec.length(v)
local Total = T*Counter

;Sub_Progress - name of script Progress
.Subs\Sub_Progress(0, 0, Total, 0, 5000, "/", "")

for(i = 0; i < TT.Length; i++)
	Target = TT.GetId(i)
	T = TT.GetMiddleCmd(i)
	if(T == Opp && validpath(Target)) do
		for(j = 0; j < Counter; j++)
			Str = Panel*Counter + j + 1
			.Subs\Sub_Progress@Current(Str)
			file.copy(v[j], Target)
		endfor
		Panel++
	endif
endfor

Comments:

Script copies all files selected (or one file under cursor) to all directories represented by tabs in the target panel.


All Scripts Total Commander TotalCmd.net PowerPro