Forums › Adobe After Effects Expressions › How to get first “Path” Property from selected objects.
-
How to get first “Path” Property from selected objects.
BayarUgrakh Batzorig updated 2 months, 2 weeks ago 2 Members · 3 Posts
-
BayarUgrakh Batzorig
January 12, 2023 at 4:08 pmI’m making a script that does things to Path on a ShapeLayer. But can’t single out the Path from multiple selectedProperties because it can be nested inside PropertyGroups. if Path’s PropertyGroups has group outside AE auto select that group too, some groups can have “Path” as name and user can accidently select multiple PropertyGroups and Paths or other Property.
var shapeLayer = app.project.activeItem.selectedLayers[0];
var props = shapeLayer.selectedProperties;
var find = cars.getElementsByName(“Path”)[0];
I have tried like this but it’s not working. Pls help.🙏
-
Dan Ebberts
January 12, 2023 at 4:25 pmLike this maybe:
var shapeLayer = app.project.activeItem.selectedLayers[0];
var props = shapeLayer.selectedProperties;
for (var i = 0; i < props.length; i++){
if (props[i].matchName == "ADBE Vector Shape"){
// do stuff
}
}
Viewing 1 - 3 of 3 posts
Log in to reply.