Swap layer mask from target to source file.

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

j_forrester

Swap layer mask from target to source file.

Post by j_forrester »

I have recently stumbled across the Apply Image function in Photoshop which looks quite interesting.

What I am looking to do is to cross-reference any layerSet names with the same name between a source file and a target file. Ideally it would be great to have a dialogue box with 2 drop down boxes one to select your source file and one to select your target file and an execute/cancel button. ( I have attached an idea for a mock up dialogue)

The source file would look at the target file and loop through all nested layerSets. If it find's a matching layerSet name between the 2 files it it takes the layer mask from the target file with the same layerSet name and applies it to the source layerSet with the corresponding name, then carries on looping until all layersets have been checked. In the case of the script finding 2 matching layersSet names, but the target layerSet does not has a layer mask it would ignore this and carry on looping.

I have recorded this operation through the script log, but this is specific to the layer name it has selected (also attached). So I am totally stumped what to do next...

Hope this all makes sense, I would really appreciate any help. I have also attached a "source" file and "target" file for testing.

Many thanks!!!!!

mask script.zip (70.9 KiB) Downloaded 50 times