Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Adding an input box to an After Effects script?

  • Adding an input box to an After Effects script?

    Posted by Stephen Kennedy on March 25, 2012 at 12:50 pm

    Hi,

    I’ve written a script that takes the selected clip and turns it into a composition of a particular size, and rescales the clip to fit that size.
    It also sets the framerate of the clip, but I’m wondering if it’s possible to introduce an element of interactivity into the process.
    What I would like is that you select a clip, run the script, and the first thing that happens is that a box appears asking what framerate you want the output composition to be, you enter a number and click OK, which then feeds the input into a variable, feeding into the script and influencing the output.

    Is this kind of thing possible in After Effects?

    I’m finding it really hard to find resources for After Effects scripting in general – most of my searches produce information on Expressions – and the After Effects acripting guide is useful, but quite difficult to dive into. Can anyone recommend any really good resources (not of pre-written specific scripts)?

    Thanks,

    Steve

    Dan Ebberts
    replied 14 years, 1 month ago
    2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 25, 2012 at 4:01 pm

    Something like this:

    var myFrameRate = parseFloat(prompt(“Please enter the frame rate.”));
    myComp.frameRate = myFrameRate;

    If you don’t have it already, you need Adobe’s JavaScript Tools guide (just Google it).

    The AE scripting guide takes some getting used to, but I can’t imagine (and certainly don’t know of) a better reference.

    Dan

  • Stephen Kennedy

    March 25, 2012 at 4:41 pm

    That’s great – thank you so much!
    I was starting to think I was going to have to get into some serious GUI scripting to accomplish that.

    One other thing: do you know if it’s possible to do something like this, but which would come up with a selector (like a drop-down menu) to choose between a number of different options?
    So it would have an input box that you would click on and it would show four different options to select from?

    Thanks again so much for your help.

    Steve

  • Dan Ebberts

    March 25, 2012 at 4:48 pm

    You’ll want to look at the UI section of the JavaScript Tools Guide. You’ll need to build a dialog with a drop-down list. It’s quite a bit more work than a simple prompt dialog.

    Dan

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