How to maintain consistent free transformation after replacing the content?
Due to the varying resolution and size of each image, after using the code below, some images may appear very large or very small, and even the coordinates and free transformation may differ.How can I maintain the consistent width, height, and free transformation of the image after replacing its content? Thank you again.
#target photoshop
var theFiles = File.openDialog("Please select a file", "*.psd;*.tif;*.jpg", false);
// Replace Smart Object contents
var idplacedLayerReplaceContents = stringIDToTypeID("placedLayerReplaceContents");
var desc3 = new ActionDescriptor();
var idnull = charIDToTypeID("null");
desc3.putPath(idnull, new File(theFiles)); // Pass the new file path to the action
var idPgNm = charIDToTypeID("PgNm");
desc3.putInteger(idPgNm, 1);
executeAction(idplacedLayerReplaceContents, desc3, DialogModes.NO);
