Help for script save as .ai and PDF with suffix in source folder

New Here ,
Apr 21, 2021 Apr 21, 2021

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?

TOPICS
Feature request, How to, Scripting

Views

99

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 21, 2021 Apr 21, 2021

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);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2021 Apr 30, 2021

Copy link to clipboard

Copied

LATEST

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;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines