Skip to main content
karthickm50893796
Inspiring
June 22, 2016
Question

Tweak required in Applescript

  • June 22, 2016
  • 2 replies
  • 455 views

Hi Can any help me to tweak below mention script

Concept : this script will save .eps to current open .ai file location

Problem : But i want to add an specific file name for example ( filename_EPS.eps) even i did the specific file name also, But i am getting .ai from current open file

see this | when i save my file

tell application "Adobe Illustrator"

activate

  set theName to name of current document

  set theNamecount to count of theName

  set theOutdatedPathObj to the file path of current document

  set thePath to (POSIX path of theOutdatedPathObj) as string

  set pathCount to count of thePath

  set pathCount to (pathCount - theNamecount)

  set newPath to (text 1 thru pathCount of thePath)

  set fullPath to (newPath & theName)

  set EPS_Path to fullPath & "_EPS.eps"

save current document in file EPS_Path as eps ¬

  with options ¬

  activate

end tell

This topic has been closed for replies.

2 replies

pixxxelschubser
Community Expert
Community Expert
June 27, 2016

The question is a little bit unclear for me. And I doesn't speak Applescript.

But if I understand you right, you want to do something like this:

alert (app.activeDocument.name.replace(".ai","_EPS.eps"));

Have fun

karthickm50893796
Inspiring
June 28, 2016

Hi pixxxel schubser

i want to export files into my current open location.

when export eps. I like to have a specific name at the end of the file name.

for Ex: filename_EPS.eps

BUT

I work these this in applescript but i am getting ( filename.ai_EPS.eps )

so its possible you to solve this problem in applescript, Javascript

pixxxelschubser
Community Expert
Community Expert
June 28, 2016

Sorry, like I said before: I don't speak Applescript.

But perhaps you can wrap this Javascript snippet in a do javascript. It is not complete but I think you should see the "new name"

tell application "Adobe Illustrator"

    do javascript " alert (app.activeDocument.name.replace(".ai","_EPS.eps"));  "

end tell

Have fun

karthickm50893796
Inspiring
June 27, 2016