Skip to main content
Participating Frequently
February 15, 2022
Answered

Duplicate a Document with multiple layers

  • February 15, 2022
  • 1 reply
  • 452 views

Hi! I was wondering if there was a script I could use to duplicate a document I have? I just need a document (which has multiple layers in it) to be duplicated. Not saved or anything, just duplicated so I have two tabs one with the original document and one with the duplicated document.

This topic has been closed for replies.
Correct answer Stephen Marsh

Image > Duplicate

1 reply

Stephen Marsh
Community Expert
Community Expert
February 15, 2022

Is there a reason why simply duplicating the current doc isn't enough? Parameters can be added in the parentheses () as per the JavaScript reference for name and mergedlayers:

 

app.activeDocument.duplicate();

 

Or:

 

var docName = app.activeDocument.name.replace(/\.[^\.]+$/, '');
app.activeDocument.duplicate(docName);

 

 

This script does the job by selecting/duplicating all layers in order to not copy file info metadata:

 

https://github.com/MarshySwamp/Remove-All-Metadata-Retain-Layers/blob/main/Remove%20All%20Metadata%20%26%20Retain%20Layers.jsx

 

 

Participating Frequently
February 15, 2022

Is there a way to duplicate the document without script?

Kukurykus
Legend
February 16, 2022

Thank you so much Stephen! You helped me on another question too! Thank you for helping me on all my questions 😛


So you asked for script that does it and then marked non-script solution as correct?