Answered
Applying a graphicStyle to a pathItem
I am attempting to apply a graphicStyle to a pathItem, but keep getting a "target layer cannot be modified" error.
Any ideas?
I am attempting to apply a graphicStyle to a pathItem, but keep getting a "target layer cannot be modified" error.
Any ideas?
As I read it you have go through the Document PathItems to get your compoundPathItem, you can't call it as a Layer object.
#target illustrator
var docRef = app.activeDocument;
with (docRef) {
var myGS = graphicStyles.getByName('Marks Graphic Style');
myGS.applyTo(compoundPathItems[0]);
}
Works for me…
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.