Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script help. Save as eps script

Community Beginner ,
Feb 21, 2023 Feb 21, 2023

I have a save as eps script with options, that when used, outputs an.eps file and also the .eps-01. I dont need it to save the .eps file, only the .eps-01. Icant spot why its saving 2 files, any ideas?

 

var doc = app.activeDocument;

var saveOpts = new EPSSaveOptions();

saveOpts.cmykPostScript = false;
saveOpts.compatibility = Compatibility.ILLUSTRATOR16;
saveOpts.embedAllFonts = true;
saveOpts.embedLinkedFiles = false;
saveOpts.includeDocumentThumbnails = false;
saveOpts.postScript = EPSPostScriptLevelEnum.LEVEL3;
saveOpts.preview = EPSPreview.None;
saveOpts.saveMultipleArtboards = 1;


var saveName = doc.name.replace(/.ai$/i, ".eps01");
var newFile = new File (saveName + "01");
doc.saveAs(doc.path, saveOpts);
doc.close();

TOPICS
Scripting
906
Translate
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

correct answers 1 Correct answer

Community Expert , Feb 21, 2023 Feb 21, 2023

Hi,

You need to comment the following line

saveOpts.saveMultipleArtboards = 1

Also, .eps01 is not the extension. It should be .eps

 

Try following version if you want to jhave -01 in the file name.

var doc = app.activeDocument;

var saveOpts = new EPSSaveOptions();

saveOpts.cmykPostScript = false;
saveOpts.compatibility = Compatibility.ILLUSTRATOR16;
saveOpts.embedAllFonts = true;
saveOpts.embedLinkedFiles = false;
saveOpts.includeDocumentThumbnails = false;
saveOpts.postScript = EPSPostScriptL
...
Translate
Adobe
Community Expert ,
Feb 21, 2023 Feb 21, 2023

Hi,

You need to comment the following line

saveOpts.saveMultipleArtboards = 1

Also, .eps01 is not the extension. It should be .eps

 

Try following version if you want to jhave -01 in the file name.

var doc = app.activeDocument;

var saveOpts = new EPSSaveOptions();

saveOpts.cmykPostScript = false;
saveOpts.compatibility = Compatibility.ILLUSTRATOR16;
saveOpts.embedAllFonts = true;
saveOpts.embedLinkedFiles = false;
saveOpts.includeDocumentThumbnails = false;
saveOpts.postScript = EPSPostScriptLevelEnum.LEVEL3;
saveOpts.preview = EPSPreview.None;
// saveOpts.saveMultipleArtboards = 1;


var saveName = doc.name.replace(/.ai$/i, "");
var newFile = new File(doc.path + "/" + saveName + "-01.eps");
doc.saveAs(newFile, saveOpts);
doc.close();
Best regards
Translate
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
Community Beginner ,
Feb 21, 2023 Feb 21, 2023
LATEST

perfect, thanks much

Translate
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