Page 1 of 1

Get selected property

Posted: May 20th, 2013, 11:27 am
by ernpchan
How can one get the selected property of a layer/effect, etc? I've tried doing a search but the search tool restrictions keep saying that I'm using words that are too common.

Re: Get selected property

Posted: May 21st, 2013, 12:43 pm
by Paul Tuersley
Both the CompItem and Layer object have a selectedProperties attribute which returns an array of the selected properties. For example, to access the first selected property on a layer:

Code: Select all

var theProp = theLayer.selectedProperties[0];
If you don't already have it you should download the AE CS6 scripting guide pdf as it covers all this stuff.

An effect doesn't have a selectedProperties attribute but you can loop through the effect's properties to see if property.selected == true, although they'll also be listed in the comp/layer selectedProperties array.

Re: Get selected property

Posted: May 22nd, 2013, 4:10 pm
by ernpchan
Thanks Paul.