Replace document name


how replace open document name new name?

 

i have script creates new name can't figure out how send new name photoshop replacing open document name.

 

here current script:

*********************

layern = activedocument.activelayer.name

var doc = app.activedocument

var fname = doc.name.split(".")

var fname = fname[0]

 

 

var newdoc = doc.duplicate(fname+layern,true)

//var newdoc = (fname+layern,true)

 

 

app.activedocument.name = newdoc

newdoc.flatten();

***************************

right 1 makes duplicate of original document document name want, rather rename original document instead of making duplicate.

 

any appreciated.

right 1 makes duplicate of original document document name want, rather rename original document instead of making duplicate.

why?

 

in javascript »file« has method »rename«.

but if file open doubt using great idea.



More discussions in Photoshop Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support