Back To Listings RSS Print

After Effects ExtendScript Training: Ep. 5

ExtendScript Script Writing Training

By David Torno | May 04, 2013

Welcome to episode 5, this week we will be accessing renderqueue items, templates, outputmodules, as well as the file output name and path. I will also be taking the single item access approach from last week and will now show you how to access multiple items. To do this we will be writing a lot more ExtendScript code and make a larger multiple line script. This is also where we are going to start combining a lot of the Javascript we learned earlier in the series as well as the code we learned in episode 4. So if you have NOT watched episode 2 & 3 ("Javascript Basics Part 1 & Part 2"), or you are unfamiliar with Javascript, I HIGHLY recommend you watch those videos otherwise you may feel a bit lost here. We will be using variables, for loops, and alerts(). Being that we are doing multiple items this time around we are also gonna dive back into the renderqueue too and I'm gonna show you how you can batch retrieve all of your chosen outputmodule names and file output paths.

As an additional bonus, I will also show you how to modify that code to batch change all of your file output folder paths to the same folder. It will be some very useful and reusable code.

If you missed any of the previous episodes in this series, follow the links below.

Episode 1 (Intro)

Episode 2 (Javascript Basics p1)

Episode 3 (Javascript Basics p2)

Episode 4 (After Effects Object Model structure overview / Script Preparation and development tips / Single Item Access of various project items, comps and layers)

In this episode:
- Renderqueue access of items, output modules and file paths
- Multiple item access of project items, comps and layers
- Batch change all renderqueue items file paths


Editor's Choice
PVC Exclusive
From our Sponsors

Share This

Back To Listings RSS Print

Get articles like this in your inbox: Sign Up


Animatexyz: | July, 22, 2013

Hi David,
I’ve been watching your tutorials and they have been a great resource. Thank you for taking the time to cover a fairly untouched topic. I was wondering how you would go about accessing the layers through any active comp rather than just the first one. I currently have it working where a button press selects all the way down to any layer with position key frames using the activeItem object but it only works on the current one when you first run the program. So if I have comp 1 selected it will work when I run it and vice versa with a second. But not concurrently. Thank you

David Torno: | July, 22, 2013

Animatexyz, activeItem only works on the currently open “active” item. It will not see other items at the same time. If you are looking to run your script on more than one composition, you will need to code it to look for all selected comps in the project panel. You would first check for item selection via “app.project.selection”. You then would use a for loop to iterate through those items checking for comps using “item instanceof CompItem” and then you would run your code inside that.

Episode 10 teaches how to obtain all the comps via a function, this will give you a good start. You can change the “itemTotal” variable to be “.selection” instead of “.numItems” and the “for” loop would then change to be “for(var i = 0; i<itemTotal; i++)”. Hopefully that helps you out. smile

Animatexyz: | July, 22, 2013

David, Thank you for the quick response. I can’t wait to try this out. I’ve been racking my brain for a week on this one. Guess I should of spent that week watching the rest of the videos. Haha

Please login or register to comment