Skip to main content
Inspiring
January 29, 2024
Answered

remove copy when I duplicate document

  • January 29, 2024
  • 2 replies
  • 1588 views

there is a way to
remove copy when I duplicate document?

 

This topic has been closed for replies.
Correct answer Davide_Barranca12040269

@DavideBarranca , please forgive another intrusion; could you chime in on short/efficient UXP-code for this task? 


Hi @c.pfaffenbichler,

I'd do it like this:

 

 

const { app, core } = require("photoshop");
await core.executeAsModal( async () => {
  app.activeDocument.duplicate(app.activeDocument.name, true);
}, { commandName: "Duplicate with the same name" });

 

 

Which seems exactly what @Ciccillotto is using 👌
The boolean is for merged layers, like in ExtendScript, BTW.

 

 

2 replies

Chuck Uebele
Community Expert
Community Expert
January 29, 2024

In the preferences, under file handling, check the box that says: "Do not append 'copy' to filename when saving a copy."

Inspiring
January 29, 2024

I didn't explain myself well when I duplicate the document the word copy comes out.

Stephen Marsh
Community Expert
Community Expert
January 29, 2024

A script can do that:

 

activeDocument.duplicate(activeDocument.name.replace(/\.[^\.]+$/, ''), false);

 

or

 

activeDocument.duplicate(activeDocument.name, false);
Ged_Traynor
Community Expert
Community Expert
January 29, 2024

@Ciccillotto you can do that from the layers panel flyout menu, if that's what you mean.