Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
It takes one property argument, and returns the layer of which this property belongs to.
function LayerParentOfProperty(property) {
try {
return property.propertyGroup(property.propertyDepth);
} catch (e) {
return property;
}
}
// example of use, gets the first selected property.
var selectedProperty = app.project.activeItem.selectedProperties[0];
if (selectedProperty) {
alert(LayerParentOfProperty(selectedProperty).name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment