Skip to main content
Participant
September 22, 2026
Question

How to check if TextFrame is being used as a mask in the clipping group

  • September 22, 2026
  • 1 reply
  • 29 views

Hey everyone! I need to check which pageItem inside the clip group is used as a mask, I’m right now stuck on TextFrame since it doesn’t expose the clipping property

1 reply

CORCTON34033231
Community Expert
Community Expert
September 22, 2026

You're right that TextFrame doesn't expose a clipping property — only PathItem and CompoundPathItem do.

 

The reliable way is to check the group itself: a clip group has its clipped property set to true, and the clipping mask is always the topmost object in the group (Adobe Help: "The first object in a layer or group becomes the clipping mask"). Since Illustrator orders pageItems from back to front, the mask is the last item:

 

var g = app.activeDocument.groupItems.getByName("your group");

if (g.clipped) {

    var maskItem = g.pageItems[g.pageItems.length - 1];

    if (maskItem.typename === "TextFrame") {

        // this TextFrame is the clipping mask

    }

}

 

This works for any pageItem type used as a mask — TextFrame included — because you identify it by its position in the group rather than a type-specific property.

 

Reference: https://helpx.adobe.com/illustrator/desktop/manage-objects/edit-objects/about-clipping-masks.html