Skip to main content
JuliaSanders99
Participant
March 4, 2025
Question

Write a script that swaps linked file inside main file

  • March 4, 2025
  • 2 replies
  • 196 views

The objective of this script is to automate my linking, saving, exporting process. Images included.

 

I have a main-image.psd from which I would like to export 3 different images. On this main-image.psd file contains “hat-link,” a linked layer that contains 3 different layers, A, B, and C. Whatever I save in hat-link.psd will populate on main-image.psd. 

 

I don’t mind my current method which is “save layer A in hat-link.psd, return to main-image.psd, export,” then repeat that with layers B, and C. The problem with this method is that it's time consuming because my linked file has around 30 layers, not 3. So far I've been saving and exporting manually.

 

Is there a script I could write that says “save layer A in hat-link.psd, return to main-image.psd, export, save layer B in hat-link.psd, return to main-image.psd, export; save layer C in hat-link.psd, return to main-image.psd, export" without doing this manually?

2 replies

Stephen Marsh
Community Expert
Community Expert
March 5, 2025

Another option is to just have standard layers with the 3 hats in an upper layer group, then have the base image in a lower group and use this script:

 

https://github.com/mechanicious/photoshopCompositionComposer

 

c.pfaffenbichler
Community Expert
Community Expert
March 5, 2025
quote

Images included.

Please provide the actual images (feel free to lores), not just screenshots. 

 

Why don’t you use Layer Comps?