args List, Template, Delim local fh = file.open(List, "r") local Slash = "\" local Path, Name, i, Dir, Str, Depth, NewName, Ext if(fh > 0) do for(not(file.eof(fh))) Str = file.readstring(fh) if(Str) do Path = file.folder(Str) ++ Slash Name = file.name(Str) Ext = "." ++ file.type(Str) Depth = word(Path, 0, Slash) - 1 NewName = Name for(i = 1; i <= Depth; i++) if(index(Template, i)) do Dir = word(Path, Depth - i + 2, Slash) NewName = Dir ++ Delim ++ NewName endif endfor file.rename(Path ++ Name ++ Ext, Path ++ NewName ++ Ext) endif endfor else messagebox("ok error", "File not opened", "FILE plugin error") quit endif file.close(fh)