My sample test code generates the following output with three files selected. Evidently the split is not working using "\n" = newline. What would be the correct split term to use?
var c = DOpus.Create.command;
c.runcommand("Clipboard COPYNAMES");
var s = DOpus.GetClip;
DOpus.output(s);
var a = s.split("\\n");
DOpus.output(a.length); C:\setup.log
C:\AdobeDebug.txt
C:\servers.ini
1 (expected to be 3)
Might be worth testing the newline chars first, before splitting file/text/clipboard content line by line.
You never know the flavour of line ending the text to split comes in, might be amiga or linux and whoops, script will fail. o)
var GetLineEndingOfText = function(text){
var lineEndings = ["\r\n","\n\r","\n","\r"], lineEnding = "";
for(var l=0;l<lineEndings.length;l++){
if (text.indexOf(lineEndings[l])!=-1){
lineEnding = lineEndings[l];
break;
}
}
return lineEnding;
}