Copies is not a child element of print options.
PrintJobOptions is a child of print options.
Copies is a child of printJobOptions.
Ok, thanks for pointing that out. I tried to change the script:
var doc = documents;
var printJobOptions = new PrintJobOptions();
printJobOptions.copies = 3;
try this sample:
var aDoc = app.documents; var printOpts = new PrintOptions(); var jobOpts = new PrintJobOptions(); jobOpts.copies = 3; printOpts.jobOptions = jobOpts; aDoc.print(printOpts);
Please do never use the name (of a method or property) for a variable. This could be quite confusing.
Thank you a lot! I tried this script out today and it work flawlessly. I can even assign a keyboard shortcut to an action which executes this script. So I can print 3 copies immediately by pressing a single button. This little script makes my work a little more pleasant. I used the name of a property for the variable to make it easier to remember what it does, but I get your point. I will avoid it, then.