Skip to main content
Known Participant
February 6, 2020
Answered

script to detect two layers define clipping mask

  • February 6, 2020
  • 2 replies
  • 2684 views

Hello all scripters,

Two layers define a clipping mask:

This is a rectangular dynamic form and a High Res smart Object.

 

Now, in a script, I have to detect that these two layers form the clipping mask.

By now, I see no property that I could use: Document.layerSets and Document.layerComps are empty, and Layers' properties don't indicate these two layers are related.

Any Idea?

This topic has been closed for replies.
Correct answer r-bin
For the first layer, the property "grouped" == true

Analyze layers down on the stack.
When you find a layer with "grouped" == false, you will get a second layer.
 

2 replies

r-binCorrect answer
Brainiac
February 6, 2020
For the first layer, the property "grouped" == true

Analyze layers down on the stack.
When you find a layer with "grouped" == false, you will get a second layer.
 
Known Participant
February 7, 2020

Thank you, I didn't see in the JS CC Ref 2019 guide that this property 'grouped' is related to a clipping mask 🙂

Is this property related to other grouping technique or just the clipping mask?

Thank you, this will help me to automate a complex workflow with resizing.

Brainiac
February 7, 2020
Previously, when there were no folder-groups in Photoshop, the clipping layers were called grouped. The name of the property was left unchanged.