Thanks guys I'm a little closer.
Peter I'm using an example Olav put together:
Olav Kvern, "Need script for printing Postscript files (ID CS2)" #4, 19 Nov 2007 4:45 pm
the reason is that his example allows you to output a document as single pages. To do this manually you need to send each page on its own. The script will do it in one hit. I've made some changes that allow the used to specify a single page if they need but would like to be able to send 1,3,5-6,9,12 for example.
If I use myDoc.printPreferences.pageRange = "1,5,6-9,11"; it will create one pdf with the pages 1,5,6-9,11 inside it.
Harbs when I tried your script it returned this in the console 1,NaN,5,NaN,6,NaN,9,NaN,1,1. It did give me an idea and I've come up with this.
var numbers, mynumbers, mydnumbers ;
numbers = "1,5,6-9,11";
var numbersarray = new Array;
numbersarray = numbers.split(',');
var mynumbers = numbersarray;
var countarray = numbersarray.length;
for(var myCounter = 0; myCounter < numbersarray.length; myCounter++){
//alert("length is "+mynumbers[myCounter].length);
if(/-/.test(mynumbers[myCounter]) == false){
alert(mynumbers[myCounter]);
}
if (mynumbers[myCounter].length >2 && /-/.test(mynumbers[myCounter])){
alert("dash num are "+mynumbers[myCounter]);
var dasharray = new Array;
dasharray = mynumbers[myCounter].split('-');
var dashnumbers = dasharray;
//alert("dash "+dashnumbers);
for (i=dashnumbers[0]; i < dashnumbers[1]; i++){
var count = dashnumbers[0];
alert(count);
}
count++;
}
}
For some reason count sticks at 6 and count++ does not loop to 7, 8, then 9. Any suggestions?