Skip to main content
Participant
February 16, 2012
Question

How to make 'Save a copy' function in the script?

  • February 16, 2012
  • 1 reply
  • 1176 views

I need 'Save a copy' function in my scipt. But i can't find this method. When use 'document.save(save as)' function, document's name is changed and can't undo last command. When use 'file.copy() ' function, new document is copied from origin, not current document. How to make it?

This topic has been closed for replies.

1 reply

கற_பன___Imagine_
Inspiring
February 16, 2012

var doc,

       docPath,

       newPath;

doc = app.activeDocument;

docPath = doc.fullName;

newPath = docPath.toString().replace(".indd", "_1.indd");

doc.saveACopy(File(newPath));

I hope that helps to you.