-
Get path to property of a layer
Hi
I’m trying to get and store, in a variable, the path to the selected property in a layer. Later I will be using this path to set the same property.
I’m a bit confused about how it works. This is my layer:My script so far:
var comp = app.project.activeItem;
var selectedProperties = comp.selectedProperties;
var property = selectedProperties[0];
alert(“Index: “+property.propertyIndex+”, Depth: “+property.propertyDepth+”, Parent: “+property.parentProperty.name);If I select Stroke Width I get:
Index: 5, Depth: 5, Parent: Stroke 1If I select Stroke 1 I get:
Index: 2, Depth: 4, Parent: ContentsIf I select Contents I get:
Index: 2, Depth: 1, Parent: circleWhy is parent of Stroke 1 Contents, and not Ellipse 1? If stroke 1 is Depth 4 and Contents is Depth 1, there must be an invisible propertyGroup?
Any clues of this behaviour? Any good tips on how to get the full path to a selected property?
Thanks,
JakobPS. I know of gimme prop path plugin which pretty much do this, however, I need to do it with code.
