1. I don't know how to resolve those relative dir names as TCC does (and I don't feel like re-inventing it). @TRUENAME would screw it all up if, for example, you were dealing with a link of any kind.If you do it, please build both an internal variable %_dlevel for %_cwd, and also a variable function for arbitrary directory or file: %@dlevel[xxx] where xxx is a directory entry, either a directory or a file (with the usual path resolution, including such relative path indicators as .. or .... (1 or 3 levels up from %_cwd, resp.). Naturally the values of %@dlevel and %@dlevel[%_cwd] and %_dlevel are to be the same.
BTW, in your sample code, why did you use IF EXIST rather than IF ISFILE?
2. ... because I've been using IF EXIST for 20+ years (an old dog/new tricks thing).