Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: Batch replace smart objects

$
0
0

I have managed to solve for this by evaluating each smart object after it is replaced and scaling it in the parent PSD. Works perfectly)! Thanks again for the feedback.

 

What I had hoped for was the ability to manipulate the new smart object contents to fit the starting size of the initial, embedded smart object.

 

Here's an example PSD file — On it, multiple layers of the same smart object (in green).

The smart object is originally 200 x 200 px.

depositphotos_10254962-Leaflet-notebook-textbook-white-blank-paper-template.jpg

 

Now, using a folder of images, I swap out the contents of the green smart object.

 

american-clothing-logos-74108.jpg

 

The logos vary in width, height, and pixel size - so when the script is run they can sometimes exceed the bounds of the green boxes in the native document.

 

Again, I have solved for this by evaluating each layer after the SO has been updated with each logo, and back in the parent PSD.

But, what I was most curious about was if it was possible to do this during the manipulation of the smart object and immediately after/during "executeAction( idplacedLayerReplaceContents, desc3, DialogModes.NO );" Thus placing a logo which is already "fitted" to the green area, without stretching the logo (beyond the transform of the parent PSD).

 

 


Viewing all articles
Browse latest Browse all 27456

Trending Articles