Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Get Transform-settings on selected layer in comp.

  • Get Transform-settings on selected layer in comp.

    Posted by Jacob Danell on July 20, 2013 at 8:14 pm

    Hi! I’m trying to extract information from a selecte precomp in the timeline.
    Right now the script looks like this:

    var activeItem = app.project.activeItem; //Selected Item
    var selectedLayer = activeItem.selectedLayers[0]; //Selected Layer
    var maincompHeight = selectedLayer.height; //Maincomps height
    var maincompWidth = selectedLayer.width; //Maincomps width

    /*Alert-test*/
    alert (selectedLayer.duration);


    so I easy can see if it’s working.
    I can get height and width without any problems but I need to get the duration, pixelaspect and framerate but I’m not possible to do it with my script at the moment. I only get “undefined”.

    Jacob Danell replied 12 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 20, 2013 at 9:17 pm

    Try this:

    selectedLayer.source.duration

    Dan

  • Jacob Danell

    July 20, 2013 at 9:19 pm

    Perfect! How could I miss it. Thank you!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy