this is not good
closes the document without saving the modified document
on the original document.
Maybe I explained myself wrong
the duplicate document
undergoes processing
at the end of the processing with the modification made
must return to the original document
Filed under the category of “be careful what you ask for, as you may receive it”…
this is not good closes the document without saving the modified document on the original document. |
Exactly my point from the beginning of the topic thread! Which is why I commented and asked:
A STEP OR TWO APPEARS TO BE MISSING…
A COPY/PASTE OR APPLY IMAGE BETWEEN THE DUPE AND ORIGINAL?
NO SAVE OF THE DUPE BEFORE CLOSING? SO WHY BOTHER?
To which you replied:
but the thing is more complex and I do not know how to explain it I put the simplest. |
Can you now see how important it is to explain clearly what you want? I appreciate that English may not be your first language…
Maybe I explained myself wrong |
Agreed.
the duplicate document undergoes processing at the end of the processing with the modification made must return to the original document |
Exactly how does the duplicate image that has undergone some unknown processing get returned to the original file?
A COPY/PASTE OR APPLY IMAGE BETWEEN THE DUPE AND ORIGINAL?
Can you perhaps show a screenshot image of the final result in the layers panel?
Here is the edited code:
#target photoshop
var originalDoc = app.activeDocument;
originalDoc.duplicate() // name parameters omitted in this simple example
var dupedDoc = app.activeDocument;
// Some unknown changes, somehow applied to something, somewhere…
dupedDoc.selection.selectAll();
dupedDoc.selection.copy(true); // merged copy = true
app.activeDocument = originalDoc
originalDoc.artLayers.add().name = 'Processed Layer';
originalDoc.paste();
app.purge (PurgeTarget.CLIPBOARDCACHE);
dupedDoc.close(SaveOptions.DONOTSAVECHANGES)
This code is making presumptions, so I have tried to make it as generic as possible without knowing your source and duplicate layer structure.