-
Access each Shape layer group with a specific name
Hey all!
I am able to add an effect (in this case, Trim Paths) to the contents of a specific shape layer group named “path”. But when there is more than one group with the same name, it only targets the last one. Is there a way to loop through all of them individually? Here’s my setup:
13760_screenshot20190928at7.03.52pm.png.zipThis code works for one instance of “path” group:
var mySelection = app.project.activeItem.selectedLayers;for (var i=0; i <mySelection.length; i++){
mySelection[i].property("Contents").property("path").property("Contents").addProperty("ADBE Vector Filter - Trim");
}
Trying to load all the groups named “path” into a variable and loop it, with no success:
var mySelection = app.project.activeItem.selectedLayers;for (var i=0; i<mySelection.length; i++){
var pathGroup = mySelection[i].property("Contents").property("path");
for (var n=0; n<pathGroup.length; n++){
var trimPaths = pathGroup[n].property("Contents").addProperty("ADBE Vector Filter - Trim");
}
}
Any ideas? Thanks!