MultiRename

Title MultiRename
File Name MultiRename.txt
Description Prepare the Multi-Rename Tool window for the specific settings
Author Vochomurka
Parameter template (saved settings) name
Plugins Called win, ini, vec
Icon
Version 2.1
Updated on 15.08.2013
args Pattern
local hwnd = win.handle("c=TTOTAL_CMD")
local Config = env("WINDIR") ++ "/wincmd.ini"
local Temp, i

local AllKeys = ini.enum_keys(Config, "rename")
local Total = line(AllKeys, 0)
local Counter = 0

for(i = 1; i <= Total; i = i + 1)
	Temp = line(AllKeys, i)
	if(index(Temp, "_name") != 0)
		Counter = Counter + 1

endfor

v = vec.create(Counter)
if(v == 0) do
	messagebox("ok error", "Vector not created", "VEC plugin error")
	quit
endif
Counter = 0

for(i = 1; i <= Total; i = i + 1)
	Temp = line(AllKeys, i)
	if(index(Temp, "_name") != 0) do
		v[Counter] = Temp
		Counter = Counter + 1
	endif
endfor

vec.sort(v)
Counter = vec.binsearch(v, Pattern ++ "_name")
vec.destroy(v)
vec.unload

win.postmessage(hwnd, 0x400+51, 2400, 0)
wait.for(1500, activewindow("c=TMultiRename"))
keys {F2}{down 4}

for(i = 0; i <= Counter; i = i + 1)
	keys {down}
endfor

keys {enter}
keys {enter}
keys {esc}

if(arg(0) == 1)
	quit

keys {tab 7}

Comments:

Command MULTIRENAME saved_rename_parameters introduced in version 7.5, does the same. But this command cn't be executed from outside Total Commander, for example, from another script.


All Scripts Total Commander TotalCmd.net PowerPro