-
Adding Shapes with ExtendScript
Hello,
I’m trying to add a a path with a stroke housed in a group. I can create the group and the path inside it, however when I try to add a stroke to the group everything breaks. Can anyone point me in the right direction? I’ve been looking at this for hours and can’t figure out where I’m going wrong.
Any help greatly appreciated.
Many thanks!
var addLayer = app.project.item(5).layers;
var addGrid = addLayer.addShape();
addGrid.label = (13);
addGrid.name = ("headline-text-grid");
var group = addGrid.content.addProperty("ADBE Vector Group");
group.name = "P1";
var myShapeGroup = group.content.addProperty("ADBE Vector Shape - Group");
myShapeGroup.addProperty("ADBE Vector Graphic - Stroke");//This line breaks everything
var myShape = new Shape();
myShape.vertices = [[-compWidth/2,-compHeight/2],[compWidth/2,-compHeight/2]];
myShape.closed = false;
// set the value of the path too the shape object
myShapeGroup.property("ADBE Vector Shape").setValue(myShape);