Skip to main content
Participant
October 12, 2023
Question

Script to Replace Contents of linked smart object, even if nested

  • October 12, 2023
  • 1 reply
  • 201 views

I have a master file with multiple smart objects.
The linked smart objects only (including nested) need to be replaced/relinked to a new file via prompt.

I have 2 different image links in the same master file. 

By replacing just one of the images that link to File 1, all instances linked to the same file are updated. I do this again to replace 1 of the images linked to File 2. As I need to do this for many new files I need to automate it. 

 

I have tried many scripts that will successfully replace contents of the active smart object, linked or not, but none that can access the nested linked object.


I am also not sure if it the command should be 'replace contents" or "relink to file". Manually both of these commands do the job, but in the script I am not sure which is most suited.

 

What would be the best method to achieve this? I don't have too much experience with scripting, but I do manage to edit and customise existing scripts. Any help would be much appreciated.

 

 

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
November 29, 2023

Nested … well, how many levels deep do you want/need to go? 

Please provide a meaningful description of the actual structure of Linked and Embedded SOs or better yet a complete set of images. 

 

This thread might provide a starting point: 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/nested-smart-objects-auto-update-2022/m-p/12967753