Get selected property

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
ernpchan
Posts: 56
Joined: February 8th, 2010, 11:27 pm

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.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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.
ernpchan
Posts: 56
Joined: February 8th, 2010, 11:27 pm

Thanks Paul.
Post Reply