Page 1 of 1

Rename opening file

Posted: Tue Nov 19, 2019 11:54 am
by klevteev
Hello
is it possible to assign a different file name to an open document?

if I make a duplicate, I can do so, but if I still want to rename the original file? not save, only rename...

Code: Select all

var aDoc = app.activeDocument;
var fileName = aDoc.name.slice(".")

var WF = Math.round(aDoc.width);
var HF = Math.round(aDoc.height);

var theCopy = aDoc.duplicate ("Face" + "_" + WF +"x" + HF + "mm_" + fileName, true);
syntax - .rename? .getByName?

How can I do this?

Re: Rename opening file

Posted: Tue Nov 19, 2019 4:56 pm
by Kukurykus
Without saving you can't.

Re: Rename opening file

Posted: Wed Nov 20, 2019 10:19 am
by klevteev
okay, so duplicate rules)