Skip to main content
Participant
January 25, 2019
Question

Search and Replace contents of smart objects script

  • January 25, 2019
  • 2 replies
  • 515 views

I am wanting a script that will search an existing photoshop file and search within a designated folder for files containing the same key words and replace the contents of the smart objects. I am mostly using photoshop for 3dsMax/Vray compositing and I want to be able to replace all of my render elements in one go to cut out alot of the manual labour.

Any scripts that you know of? I feel this must be possible but I know next to nothing about Javascript.

Any help is greatly appreciated.

Thanks,
Harrison

This topic has been closed for replies.

2 replies

JJMack
Community Expert
Community Expert
January 26, 2019

harrisonm1991  wrote

I feel this must be possible but I know next to nothing about Javascript.

You would need a very specializes script designed to do the processing you need done. If you do not know how Photoshop works well even if you heir a programmer that is a Photoshop scripting specialist you may not be able to design a process the can be automated. 

While it is easy to locate Smart Object layers and replace the layer content.  The replacement content must be exactly the same size and resolution as the smart Object layers original content and the content must be the content you want that smart object layers to have. So the script need a lot more logic then just find a smart object layer.  The script need logic that will locate the smart object layer you want to update.  Need to know the size and resolution that smart object is or be able to retrieve that information.  Then it needs to know where the correct replacement file object is that has the correct size, resolution and quality.  Or be able the to create a replacement object file. While a script can resize images to a specific size and resolution  doing so  the resize will loose quality and may distort the object.

A script to cut out your manual labor must be able to do you manual labor process and that process need to be a repetitive process that can be automated with the proper logic. 

If you feel your manual labor can be automated heir a programmer. You will not be able to automate yourself without any JavaScript knowledge.

JJMack
c.pfaffenbichler
Community Expert
Community Expert
January 26, 2019

You may want to elaborate on the exact Layer and keyword structure and folder/image structure, posting screenshots might help illustrate.