Try this code:
var storeUserInteract = userInteractionLevel; var d = activeDocument; var filePath = '/d/test_prnt.ps' // your print file name var jbOpts = new PrintJobOptions(); var opts = new PrintOptions(); opts.printPreset = "PrintMe"; opts.jobOptions = jbOpts; jbOpts.file = new File(filePath); userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS; d.print(opts); userInteractionLevel = storeUserInteract;
Thank you so much... Works perfect
I did modify slightly to remove the file path option and it worked flawlessly...
var storeUserInteract = userInteractionLevel;
var d = activeDocument;
var jbOpts = new PrintJobOptions();
var opts = new PrintOptions();
opts.printPreset = "PrintMe"; //Insert Your Own Custom Print preset between quotes
opts.jobOptions = jbOpts;
userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
userInteractionLevel = storeUserInteract;
Figured it out. I followed the suggestion for VBScript and ran MS Word's VBA editor and looked at the Illustrator object model with the object browser. The spec' for the File member of PrintJobOptions is just String. So, I created a PrintJobOptions object, set the File member to the name of the file I wanted to print to, and set the PrintOptions.jobOptions member to the PrintJobOptions that I had just created. It works great. Thanks anyway.