Select All > Make Clipping Mask

Copy link to clipboard
Copied
Hi all,
I'm trying to write a script that kills a repetative task and I'm struggling with the part where I want to go Select All > Make Clipping Mask.
My script creates a new upper layer with the path item that I want to use for the mask, and the artwork may exists in several layers underneath. I'm lost at the point where I want to select everything inluding the mask object (which will be on top) and go >make clipping mask. Any help much appreciated as always! I've trawled the forum but can't find anything...
Cheers,
S
Explore related tutorials & articles
Copy link to clipboard
Copied
In script you need to make a group item and move all your page items into this group… then you can set the clipped/clipping properties to true… You will find previous examples of this here… You don't select objects with scripting…
Copy link to clipboard
Copied
here's a clipping mask sample

Copy link to clipboard
Copied
Thanks dudes, I got it going!
Copy link to clipboard
Copied
can you run app.executeMenuCommand('group'); on the selection and then clip the selection?

