-
Create Shape Layer with a script – how to control properties?
Hi There,
here is what I am trying to do: I want to create shape layers in the form of a hexagon (polystar path, type polygon with 6 points).
After a lot of searching I found a method to create an ellipse shape layer (addProperty(“ADBE Vector Shape – Ellipse”)) and by trial and error found out, that “addProperty(“ADBE Vector Shape – Star”)” gives me a Polystar shape. But trying to change the “Type”-Property I come up empty handed.
Is there a resource where one can look up the correct property-names? How do you find out that for example “ADBE Vector Shape – Star” is the correct parameter to get a polystar? I had to literally GUESS to get that. There must be some kind of reference manual. In the CS6 Scripting Guide I find nothing.
Can somebody help me out here?
Thanks in advance
app.beginUndoGroup("Add new shape layer");var curComp = app.project.activeItem;
if(curComp){ var shapeLayer = curComp.layers.addShape();
var shapeGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group");
shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Star");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Stroke");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
}app.endUndoGroup();