Copy link to clipboard
Copied
I have a document that I want to save the .ai file that is open....then save as a pdf with my own Adobe PDF Presets. The name of my preset is: Machine Views
Example sudo code:
#target illustrator
var doc = app.activeDocument;
// just save it as the .ai that it is
doc.save();
// save .ai as .pdf with custom named preset
doc.savePDF("Machine Views");
Hello subieguy2
Try this
...#target illustrator
var doc = app.activeDocument; // get the active document
// set up the pdf save options
var pdfOptions = new PDFSaveOptions();
pdfOptions.pDFPreset = "Machine Views";
// set up the ai save options
var aiOptions = new IllustratorSaveOptions()
aiOptions.compatibility = Compatibility.ILLUSTRATOR8;//change this to what ever version of ai you want to save it as
// create the save
Copy link to clipboard
Copied
Hello subieguy2
Try this
#target illustrator
var doc = app.activeDocument; // get the active document
// set up the pdf save options
var pdfOptions = new PDFSaveOptions();
pdfOptions.pDFPreset = "Machine Views";
// set up the ai save options
var aiOptions = new IllustratorSaveOptions()
aiOptions.compatibility = Compatibility.ILLUSTRATOR8;//change this to what ever version of ai you want to save it as
// create the save folder object
var myFolder = Folder([folderpath]); // Set the folder path where you want to save the files
// Create the ai File object
var aiFile = new File(myFolder + [filename] + ".ai");
// create the pdf File object
var pdfFile = new File(myFolder + [filename] + ".pdf");
//save the ai file
doc.saveAs (aiFile, aiOptions);
// save the pdf file
doc.saveAs (pdfFile, pdfOptions);
Hope that helps!
-Boyd
Copy link to clipboard
Copied
Worked like a charm! Thanks so much Boyd!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now