Skip to main content
Known Participant
November 10, 2008
Answered

Remove clipping mask

  • November 10, 2008
  • 12 replies
  • 93340 views
I need to remove the clipping mask in illustrator file through programmatically(Visual Basic (or) Javascript). Kindly advice me.

Thanks,
Prabudass
This topic has been closed for replies.
Correct answer KennethWebb

I realize this is an old thread, but I ran across it while looking for a solution to removing multiple clipping masks scattered throughout a document.

If you need to remove all the clipping masks from a document, here is a pretty simple script that will check all the pageItems and remove any that are being used as a clipping mask.

Comment out the last line if you don't want to see how many paths were deleted.  Its not a necesarry feature, but I like to know how many objects get deleted when I run something like this.

#target Illustrator

// script.name = RemoveClippingMasks.jsx

// script.description = deletes all PageItems being used as clipping masks.

// script.parent = Kenneth Webb // 01/07/2013

// script.elegant = true?

var docRef = app.activeDocument;

var clippingCount = 0

clipScan()

//loops through all pageItems, removing those that are clipping masks

function clipScan () {

    for (i=docRef.pageItems.length-1;i>=0;i--) {

        if (docRef.pageItems.clipping == true){

            docRef.pageItems.remove();

            clippingCount++;

        }

    }

};

alert ("All "+clippingCount+" Clipping Masks Removed")


Cheers!

12 replies

Inspiring
February 11, 2009
Look for a path item whose "clipping" property is set to true, and do:<br /><br /><pathItem>.clipping = false<br /><br />or just delete it...
Larry G. Schneider
Community Expert
Community Expert
November 10, 2008
The clipping mask will be the first path item in a grouped item. Exactly how to identify it is not readily apparent.