Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GoodBoyNinja/a9c3b736facd399345c67ec34a160ab0 to your computer and use it in GitHub Desktop.
Save GoodBoyNinja/a9c3b736facd399345c67ec34a160ab0 to your computer and use it in GitHub Desktop.
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