EnvVars

Title EnvVars
File Name EnvVars.txt
Description Go to the directory corresponding to the choosen environment variable. Copy its name to the clipboard
Author Vochomurka
Parameters -
Plugins Called win, file, vec, clip
Icon
Version 1.0
Updated on 02.03.15
static Quote = esc(?+\"+, ?+\+)
static EmEditor = "e:\Utils\Text\EmEditor\emeditor.exe"
local hwnd = win.handle("c=TTOTAL_CMD")
local Exepath = win.exepath(hwnd)
local Panel = pprofolder ++ "\scripts\EnvVars.dat"
local EV = file.readall(Panel)
local v = vec.createfromlines(EV)
local EL = "¶ Edit List..."

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

local N = v.length()

local w = vec.create(N)

if(w <= 0) do
	messagebox("ok error", "Vector not created", "VEC plugin error #2")
	quit
endif

for(i = 0; i < N; i++)
	w[i] = v[i]
	if(v[i] == EL)
		continue

	v[i] = v[i] ++ " -> " ++ env(v[i])
endfor

local Path = v.showmenu

if(Path == -1)
	quit

EV = v[Path]

if(EV == EL) do
	do(EmEditor, Panel)
	quit
endif

clip.set(EV)
do(Exepath, "/O /S /T " ++ Quote ++ EV ++ Quote)

Comments

Script reads list of environment variables from this file. The list is expanded, that is, contains both variable name and its value. At clicking on the item the directory corresponding to the choosen variable is open, and the variable name is copied to the clipboard


Main Page Total Commander PowerPro