RunAnyCm_

Title RunAnyCm_
File Name RunAnyCm_.txt
Description Select any TC's command and execute it
Author Vochomurka
Parameters -
Plugins Called win, ini
Icon
Version 1.0
Updated on 01.09.2006
local hwnd = win.handle("c=TTOTAL_CMD")
local Coms = "path\TOTALCMD.INC"
local Sections = ini.enum_sections(Coms)
local NS = line(Sections, 0)
local CR = esc(?+\n+, ?+\+)
local i, j, All, Cles, OneSec, NK, Comm, Semicolon, Numbers, OneKey

for(i = 1; i <= NS; i++)
	OneSec = line(Sections, i)
	Cles = ini.enum_keys(Coms, OneSec)
	NK = line(Cles, 0)
		for(j = 1; j <= NK; j++)
			Comm = line(Cles, j)
			OneKey = ini.get(Coms, OneSec,  Comm)
			Semicolon = index(OneKey, ";")
			if(Semicolon == length(OneKey))
				continue

			Numbers = Numbers ++ select(OneKey, Semicolon - 1) ++ CR
			All = All ++ Comm ++ " = " ++ OneKey ++ CR
		endfor
endfor
pickstring(All, "Select a command to run")

if(not _pickedline_)
	quit

NS = line(Numbers, _pickedline_)
win.sendmessage(hwnd, 0x400+51, NS, 0)

Main Page Total Commander PowerPro