Phew... for a moment I thought it should be some kind of limitation, being that the number of maximum items selected as source or target forcibly having to be "1".
Then I tested the $source comment - it was an option/suggestion, not a denial.
The custom version (backup instead of copy - yes, it works!, work with several items as source, minor end-of-process cosmetic changes) goes like this:
Code: Select all
//select in left pane one file to copy.
//switch to right pane and select target folders.
//execute this script:
//get target folders names:
$targets = getinfo("SelectedItemsPathNames", "|");
//go back to left and get selected item:
focus "pi";
$source = getinfo("SelectedItemsPathNames", "|"); //"<curitem>";
//for each target in targetS do:
$Loop=1;
while(1){
$target = gettoken($targets, $Loop, "|");
if ($target==""){break;}
//copy source to current selected target:
//copyto location, source
backupto $target, $source;
incr $Loop;
}
focus "pi";
// goto gettoken($targets, 1, "|");
status "Selection/bkp propagated. Thanks!"
I'm yet to understand if/then/elseif and loop/incremental commands to work on several items at a time. Hope this one enlights me...
-am I missing something or I "really" can't directly set several destination paths as source for backup/copy operations, except by repeating the commands, one command per destination?
Code: Select all
//wrong???
copyto "<xydata>\BKPs\|d:\backups\|c:\burn\today", "<xydata>\*.ini|<xydata>\*.dat|<xydata>\FindTemplates";
instead of
Code: Select all
//right!
copyto "<xydata>\BKPs\", "<xydata>\*.ini|<xydata>\*.dat|<xydata>\FindTemplates";
copyto "d:\backups\", "<xydata>\*.ini|<xydata>\*.dat|<xydata>\FindTemplates";
copyto "c:\burn\today", "<xydata>\*.ini|<xydata>\*.dat|<xydata>\FindTemplates";
Thanks!