having 3 days of trouble with this. Trying to pass filepaths from an array and add them to cmd object which should then copy them to collection. What seems to happen is that when the cmd is run, each path is added twice - which results in errors that 'file already added to collection' :
Any ideas would be helpful.
var groupPathsARR = []
for (var GROUPkey in tokensOBJ) {
if (tokensOBJ.hasOwnProperty(GROUPkey) && counter < 10) {
groupPathsARR = tokensOBJ[GROUPkey];
for (var i = 0; i < groupPathsARR.length; i++) {
cmd.AddFile(groupPathsARR[i]);
}
copyVirtuallyToCOll = 1;
if (copyVirtuallyToCOll) {
cmd.RunCommand('COPY TO coll://DUPES ');
}
}
counter++;
// cmd.ClearFiles();
}```