Copy link to clipboard
Copied
Hi there,
I wonder how to access the dash options of a stroke via script.
I could create a stroke line and set values like width and color but I have no idea how to activate the dash.
Is access via script not possible?
Thanks!
Der Hirk
Copy link to clipboard
Copied
Property groups. If a property isn't persistently and explicitly exposed or is contextual, it may show up by iterating through its group and finding its index.
Mylenium
Copy link to clipboard
Copied
Ähh..I would like to add the porperty "ADBE Vector Stroke Dashes" to the property "Content" or "ADBE Vector Shape - Rect" or "ADBE Vector Grafic - Stroke" or I dont know where to add it.
I also tried to use "setValue" for "property "ADBE Vector Stroke Dashes" or simply "Dashes" and of course the whole hose of properties but nothing works.
Is "ADBE Vector Stroke Dashes" a member of the "Contents" property or is this subordinate to "Stroke"? it does not seem to belong anywhere.
I have no idea how to iterate through a list of names(strings) or how to iterate through an Array with unknown dimensions and lenght.
thanks anyway
Copy link to clipboard
Copied
This snippet should give you tools you need to add a dash:
var myComp = app.project.activeItem;
var myLineLayer = myComp.layers.addShape();
var myShapeLayerContents = myLineLayer.property("ADBE Root Vectors Group");
var myShapeGroup = myShapeLayerContents.addProperty("ADBE Vector Group");
var myShapeContents = myShapeGroup.property("ADBE Vectors Group");
var myPathGroup = myShapeContents.addProperty("ADBE Vector Shape - Group");
var myPath = myPathGroup.property("ADBE Vector Shape");
var myShape = myPath.value;
myShape.vertices = [[0,0], [200,200]];
myShape.inTangents = [];
myShape.outTangents = [];
myShape.closed = false;
myPath.setValue(myShape);
var myStroke = myShapeContents.addProperty("ADBE Vector Graphic - Stroke"); // invalidates path
var myDash = myStroke.property("ADBE Vector Stroke Dashes").addProperty("ADBE Vector Stroke Dash 1");
myDash.setValue(25);
Dan
Copy link to clipboard
Copied
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more