# How to realize clipping mask?

**URL:** <https://forums.creativeclouddeveloper.com/t/how-to-realize-clipping-mask/2582>\
**Category:** Photoshop\
**Tags:** javascript\
**Created:** [February 24, 2021, 2:46pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-realize-clipping-mask/2582 "2021-02-24T14:46:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [February 24, 2021, 2:46pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-realize-clipping-mask/2582/1 "2021-02-24T14:46:07Z")

</div>

Hello everyone,

how to judge the state of cut mask in uxp?  
activeDocument.activeLayer.grouped

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [February 24, 2021, 3:01pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-realize-clipping-mask/2582/2 "2021-02-24T15:01:07Z")

</div>

Hi, what do you want to achieve ?  
Do you want to check if the current layer is a clipping mask, or is in a group ?

---

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [February 25, 2021, 5:34am UTC](https://forums.creativeclouddeveloper.com/t/how-to-realize-clipping-mask/2582/3 "2021-02-25T05:34:08Z")

</div>

Hello,  
I want to know whether the layer is a clipping mask through the code, similar to the function in CEP: return activeDocument.activeLayer.grouped

---

<div class="post-metadata">

**Author:** ![simonhenke](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/simonhenke/32/957_2.png) [@simonhenke](https://forums.creativeclouddeveloper.com/u/simonhenke)\
**Post date:** [February 25, 2021, 11:16am UTC](https://forums.creativeclouddeveloper.com/t/how-to-realize-clipping-mask/2582/4 "2021-02-25T11:16:55Z")

</div>

```
function isClipped(){
  return photoshop.action.batchPlay([
    {
      _obj: 'get',
      _target: [
        { _property: 'group' }, 
        { _ref: 'layer', _enum: 'ordinal', _value: 'targetEnum' }
      ],
    },
  ], { synchronousExecution: true })[0].group
}

```

This checks if the currently selected layer is “clipping down”.

---

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [February 25, 2021, 12:20pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-realize-clipping-mask/2582/5 "2021-02-25T12:20:47Z")

</div>

Thank you very much. It works.
