: Illustrator Script to create Clipping Mask How is it possible to create a clipping mask with a illustrator javascript script? I tried this, but it doesnt work. var group = app.activeDocument.groupItems.add();
How is it possible to create a clipping mask with a illustrator javascript script?
I tried this, but it doesnt work.
var group = app.activeDocument.groupItems.add();
var rect = layer.pathItems.rectangle( height, 0.0, width, height );
rect.moveToBeginning( group );
var ellipse = layer.pathItems.ellipse(ellipseLeft, ellipseTop, ellipseWidth, ellipseWidth);
ellipse.clipping = true;
ellipse.moveToBeginning( group );
What i need is a working code sample
More posts by @Miguel516
1 Comments
Sorted by latest first Latest Oldest Best
You need to set the group to be clipped too (after adding your paths). I believe setting the ellipse to be the clipping mask is unnecessary if it is the last object you add (the top object in the group should become the clipping path if you don't specify).
var group = app.activeDocument.groupItems.add();
var rect = layer.pathItems.rectangle( height, 0.0, width, height );
rect.moveToBeginning( group );
var ellipse = layer.pathItems.ellipse(ellipseLeft, ellipseTop, ellipseWidth, ellipseWidth);
ellipse.clipping = true;
ellipse.moveToBeginning( group );
group.clipped = true; // <-- Add this after adding your paths to the group.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.