Skip to main content
Known Participant
June 26, 2023
Answered

need help with a simple script...

  • June 26, 2023
  • 3 replies
  • 595 views

i dont know why but the attached snippet keeps saving my file (currently a .eps) as a .ai file. i need it to save out as a .eps. what do i need to change?

// The active document
var doc = app.activeDocument;
// The path of the original document
var originalDocPath = doc.path;
// The name of the original document
var originalDocName = doc.name;
// Get just the file name. Ignore the file extension
originalDocName = originalDocName.replace(/\.pdf|\.eps|_1c\.eps|\.ai/gi, "")
// Save the active document as a .eps with _1C
doc.saveAs(File(originalDocPath + "/" + originalDocName + "_1C.eps"));
 
scott
This topic has been closed for replies.
Correct answer pixxxelschubser

You need EPS save options.

E.g. here:

https://community.adobe.com/t5/illustrator-discussions/script-help-save-as-eps-script/m-p/13596642

3 replies

pixxxelschubser
Community Expert
Community Expert
June 26, 2023

Glad it's working for you.

 

By the way:
At the bottom of the page linked by M you will also find a good working example. I will also mark this answer as correct.

pixxxelschubser
Community Expert
pixxxelschubserCommunity ExpertCorrect answer
Community Expert
June 26, 2023
@Js1212Author
Known Participant
June 26, 2023

thank you....that got me up and running!!!!

 

@Js1212Author
Known Participant
June 26, 2023

...at first glance that is going right over my head....i am just beginning scripting and so far have just been modifying existing snippets that i have found and been stringing them together to get what i am trying to do. is there a simple solution?

 

scott