Created
February 1, 2021 13:45
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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