args Path, Obj local hwnd = win.handle("c=TTOTAL_CMD") local Config = env("WINDIR") ++ "\wincmd.ini" local ColorKeys = ini.enum_keys(Config, "Colors") local Counter = line(ColorKeys, 0) local Panel = ifelse(tc.active(hwnd) == "left", 8, 7) local TMLB = childwin.handle(hwnd, "TMyListBox", Panel) local i, j, OneKey, Str v = vec.create(0, 1) if(not v) do messagebox("ok error", "Vector not created", "VEC plugin error #1") quit endif for(i = 1; i <= Counter; i++) OneKey = line(ColorKeys, i) if(index(OneKey, "ColorFilter") != 0 && revindex(OneKey, "Color") == 1) do OneKey = ini.get(Config, "Colors", OneKey) vec.insert(v, vec.length(v), OneKey) endif endfor Counter = vec.length(v) if(not Counter) do Str = "No color filter is specified in configuration" messagebox("ok warning", Str, "DetectColorFilter Script") vec.destroy(v) quit endif w = vec.create(0, 1) if(not w) do messagebox("ok error", "Vector not created", "VEC plugin error #2") quit endif win.sendmessage(hwnd, 0x400+51, 524, 0) ColorKeys = clip.get if(file.isfolder(Path ++ Obj)) do Obj ++= "\" flag set 1 else flag clear 1 endif for(i = 0; i < Counter; i++) osd.show(i + 1 ++ " / " ++ Counter, "INFINITE", "30", "Arial", "-1", "255 000 000") for(win.class(win.getfocus()) != "TMyListBox") endfor win.postmessage(hwnd, 0x400+51, 521, 0) for(win.class(win.getfocus()) == "TMyListBox") endfor OneKey = win.getfocus() for(win.class(OneKey) != "Edit") OneKey = win.getfocus() endfor win.settext(OneKey, v[i]) keys {enter} for(win.class(OneKey) == "Edit") OneKey = win.getfocus() endfor OneKey = win.getfocus() win.sendmessage(OneKey, 245, 0, 0) for(win.class(win.getfocus()) == "Button") win.sendmessage(win.getfocus(), 245, 0, 0) endfor OneKey = win.sendmessage(TMLB, 0x0190, 0, 0) if(OneKey) do clip.clear win.postmessage(hwnd, 0x400+51, 2017, 0) wait.for(clip.get) Str = clip.get for(j = 1; j <= OneKey; j++) if(line(Str, j) == Obj) do Panel = ini.get(Config, "Colors", "ColorFilter" ++ i + 1) vec.insert(w, 0, Panel) endif endfor win.postmessage(hwnd, 0x400+51, 524, 0) endif endfor osd.hide clip.set(ColorKeys) Panel = vec.length(w) if(not Panel) do Str = "Are you really sure the file/directory " ++ Obj ++ " is colored?" messagebox("ok warning", Str, "No appropriate color filter found") vec.destroy(v) vec.destroy(w) quit endif OneKey = Panel ++ " color filters found for " OneKey = OneKey ++ ifelse(pproflag(1), "directory ", "file ") ++ Obj Str = "" for(i = Panel - 1; i >= 0; i--) for(j = 1; j <= Counter; j++) if(v[j - 1] == w[i]) do Str = Str ++ "Color filter #" ++ j ++ ": " Str = Str ++ remove(w[i], 1) ++ esc(?+\n+, ?+\+) endif endfor endfor messagebox("ok information", Str, OneKey) vec.destroy(v) vec.destroy(w)