Skip to content

Instantly share code, notes, and snippets.

@gabelloyd
Last active August 29, 2015 14:19
Show Gist options
  • Save gabelloyd/76bdf33205749f08c7b9 to your computer and use it in GitHub Desktop.
Save gabelloyd/76bdf33205749f08c7b9 to your computer and use it in GitHub Desktop.
Save all open docs in Illustrator (any version)
// save all open docs in Illustrator
// originally by carlos canto
// http://forums.adobe.com/message/6161400?tstart=0#6161400
for (i=0; i<app.documents.length; i++)
{
var idoc = app.documents[i];
//alert("+"+idoc.path+"+");
if (idoc.path == "")
{
file = File.saveDialog ("Save file...");
idoc.saveAs (file);
}
else
{
//alert(idoc.name);
if (!idoc.saved)
{
idoc.save();
idoc.saved = true;
}
}
}
// save all open docs, pdf compatible unchecked
// carlos canto
// http://forums.adobe.com/message/6161400?tstart=0#6161400
var saveOptions = new IllustratorSaveOptions();
saveOptions.pdfCompatible = false;
for (i=0; i<app.documents.length; i++) {
var idoc = app.documents[i];
if (idoc.path == "") {
file = File.saveDialog ("Save file...");
idoc.saveAs (file, saveOptions);
}
else {
if (!idoc.saved) {
idoc.saveAs (idoc.fullName, saveOptions);
idoc.saved = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment