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

need help with a simple script...

Explorer ,
Jun 26, 2023 Jun 26, 2023

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
TOPICS
Scripting
387
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 2 Correct answers

LEGEND , Jun 26, 2023 Jun 26, 2023
Community Expert , Jun 26, 2023 Jun 26, 2023
Translate
Adobe
LEGEND ,
Jun 26, 2023 Jun 26, 2023
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
Explorer ,
Jun 26, 2023 Jun 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

 

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 Expert ,
Jun 26, 2023 Jun 26, 2023
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
Explorer ,
Jun 26, 2023 Jun 26, 2023

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

 

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 Expert ,
Jun 26, 2023 Jun 26, 2023
LATEST

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.

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