Copy link to clipboard
Copied
Hello everyone I need an illustrator script. What he has to do is very simple. It has to do a "save as" and save the file (.ai ) I was working with in the same source folder. In addition, it must add a suffix (in this case -mont). Then a second script but this time instead of being an .ai it's a pdf. Can anyone help me?
Copy link to clipboard
Copied
var path1 = app.activeDocument.fullName.fullName.replace(/\.[^\.]+$/, "");
var file1 = new File(path1 + "mont.ai")
var AI1 = new IllustratorSaveOptions;
app.activeDocument.saveAs(file1, AI1);
var PDF1 = new PDFSaveOptions;
app.activeDocument.saveAs(file1, PDF1);
Copy link to clipboard
Copied
Okay later I'm also using this script which allows me to print to a printer preset. But in reality this printer that I use is not real printer but a virtual printer to genrate PDFs with color seprations. So later he also ask me where to save the generated PDF: Do u know how I can give him the command to save it to me in the usual folder with a suffix (in this case + sep) ? thank you very much indeed
var storeUserInteract = userInteractionLevel;
var d = activeDocument;
var jbOpts = new PrintJobOptions();
var opts = new PrintOptions();
opts.printPreset = "separazioni"; //Insert Your Own Custom Print preset between quotes
opts.jobOptions = jbOpts;
userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
d.print(opts);
userInteractionLevel = storeUserInteract;