# Can we just replace the last element of a mask group to make a new mask?

**URL:** <https://forums.creativeclouddeveloper.com/t/can-we-just-replace-the-last-element-of-a-mask-group-to-make-a-new-mask/936>\
**Category:** UXP Plugin API\
**Created:** [June 24, 2019, 12:50pm UTC](https://forums.creativeclouddeveloper.com/t/can-we-just-replace-the-last-element-of-a-mask-group-to-make-a-new-mask/936 "2019-06-24T12:50:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpryland](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/cpryland/32/1172_2.png) [@cpryland](https://forums.creativeclouddeveloper.com/u/cpryland)\
**Post date:** [June 24, 2019, 12:50pm UTC](https://forums.creativeclouddeveloper.com/t/can-we-just-replace-the-last-element-of-a-mask-group-to-make-a-new-mask/936/1 "2019-06-24T12:50:17Z")

</div>

Or do we have to ungroup, re-select the other elements and then use createMaskGroup to re-create the group?

---

<div class="post-metadata">

**Author:** ![stevekwak](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/stevekwak/32/48_2.png) [@stevekwak](https://forums.creativeclouddeveloper.com/u/stevekwak)\
**Post date:** [June 25, 2019, 2:25pm UTC](https://forums.creativeclouddeveloper.com/t/can-we-just-replace-the-last-element-of-a-mask-group-to-make-a-new-mask/936/2 "2019-06-25T14:25:24Z")

</div>

Unfortunately, if the action is not possible on the XD app itself, it cannot be programmatically done using plugins.
