Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions ExtendScript obvious Basics

  • ExtendScript obvious Basics

  • Rico Rondel

    May 25, 2021 at 10:37 am

    Hello guys,I’m new to ExtendScript but I want to be able to write scripts for both Premiere and After Effects to improve my personal workflow.One thing I can’t seem to figure out is, how I can work with specific selections. I do know selectedLayers in After Effects, but what about selected Keyframes? I have the same problem with Premiere.For example: I want to change the influence and speed of (a) selected Keyframe(s). I know how to change the speed and influence when using indexes but I want my script to work with just the selection.Same problem for Premiere. I can do a whole lot with indexes but how can I access the selected clip(s) to change parameters or apply effects on just the selected clips?Maybe someone can help me with that very basic problem that seems to stop me for creating scripts in a very early stage. Thank you in advace!

  • Filip Vandueren

    June 8, 2021 at 6:56 pm

    Hi Rico, there is no method or property like selectedKeys() in extendscript.

    You have to loop through the keyframe indexes and check for keySelected(), something like this:

    myProperty = app.project.activeItem.selectedLayers[0].selectedProperties[0];
    selectedKeyIndexes=[];
    for (i=1; i<=myProperty.numKeys; i++) {
    if (myProperty.keySelected(i)) selectedKeyIndexes.push(i)
    }

    When you find a slected keyframe, yuo can’t just store that “keyframe” as an object that contains time, value, easing etc. you have to adjust each aspect of a keyframe with its own method keyValue, keyTime, keyRoving, setInterpolationTypeAtKey() etc. etc.

Viewing 1 - 2 of 2 posts

Log in to reply.

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