ZTree.com  | ZEN  | About...  

 Index   Back

[ZEP] New Batch Parameters   [ZEP]

By: John Gruener     Orlando, Florida  
Date: Sep 29,2019 at 15:06
In Response to: [ZEP] A new % value (Walt)

> I would like to request %c (child) be added to the list of
> Batch Parameters.
>
> >> Given the directory structure: C:\AAA\BBB\CCC\DDD\EEE\FFF
> >> CCC is the currently directory
> >> %c returns DDD\EEE\FFF
>
> Potential enhancement:
> %c0 returns CCC\DDD\EEE\FFF
> %c1 returns DDD\EEE\FFF
> %c2 returns EEE\FFF
> etc.

> ... the current file is in
> FFF, chosen from the BSG list under CCC, so %c
> returns the path to the file...
>
> Also, if the file is in EEE of course %c returns
> DDD\EEE

I have several scripts that would benefit from the addition of the proposed variables. The need is to replicate the same source path under the target directory as what Alt-Copy/Move would create. Currently these scripts have to use %3, which of course generates the full source path under the target.

The only ZTree batch parameter that references the Current Branch directory entered with the Branch command is %r. Unfortunately this is useless for this purpose, mainly because it does not include the subdirectory path to the current file. It also includes the unwanted full path to the root of the drive, including the drive letter.

I think the best solution would be to provide the same capabilities as Alt-Copy/Move, using the same Full, Current and Relative mnemonics.

Since it's usually referring to the directory entered with the Branch command, I've come to agree with Ben that the best parameter would be %b. But we need at least two variations to provide the same capabilities as Alt-Copy/Move.

So I propose the following two parameters:
%bc = Branch Current directory path.
%br = Branch Relative directory path.

Comparing to Walt's parameters:
%bc = %c0
%br = %c and %c1

Since the paths generated by Alt-Copy/Move Full are not relative to the Current Directory entered by the Branch command, the above mentioned %3 can be used to generate the full path to the file. But for simplicity, clarity and completeness the following two redundant parameters could also be added:
%b = %2:%3 = Branch root path to the file including the drive letter and colon.
%bf = %3 = Branch Full path to the file without the drive letter and colon.

So using Walt's examples, if the directory entered with the Branch command is:
C:\AAA\BBB\CCC

and the file being accessed is in directory:
C:\AAA\BBB\CCC\DDD\EEE\FFF

then:
%b = C:\AAA\BBB\CCC\DDD\EEE\FFF
%bf = \AAA\BBB\CCC\DDD\EEE\FFF
%bc = \CCC\DDD\EEE\FFF
%br = \DDD\EEE\FFF

In all cases, %bf, %bc and %br would return the exact same paths that Alt-Copy/Move would use for their respective functions, including if they are generated from a normal, Showall or Global file window.

Whatcha think? ;-)

- John

57 views      
 

Messages in this Thread

 
94,499 Postings in 11,924 Threads, 348 registered users, 9 users online (0 registered, 9 guests)
Index | Admin contact |   Forum Time: Oct 23, 2019 - 7:09 pm EDT  |  Hits:28,802,195  (5,943 Today )
RSS Feed