Rename opening file

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: xbytor, DavideBarranca, Paul MR

Post Reply
klevteev
Posts: 10
Joined: Wed Nov 06, 2019 1:22 pm

Rename opening file

Post by klevteev » Tue Nov 19, 2019 11:54 am

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?

User avatar
Kukurykus
Posts: 225
Joined: Mon Jul 25, 2016 12:36 pm

Re: Rename opening file

Post by Kukurykus » Tue Nov 19, 2019 4:56 pm

Without saving you can't.

klevteev
Posts: 10
Joined: Wed Nov 06, 2019 1:22 pm

Re: Rename opening file

Post by klevteev » Wed Nov 20, 2019 10:19 am

okay, so duplicate rules)

Post Reply