Easing the gif creation process part 2: ExtendScript
Written on 15 October 2013, 10:10pm under Techniques
In this second article about easing the gif creation process we’ll see how we can automate the process of firing up the render and sending the video file to Photoshop with some ExtendScript.
First, what is ExtendScript?
We will not go over the basics of ExtendScript in this article since they’ve been explained here and there already. Here is some resources to help you get started with ExtendScript:
- David Torno’s extensive After Effects ExtendScript Training
- After Effects CS6 Scripting Guide
Get the script
Just save Render and Send to Photoshop.jsx in your After Effects scripts folder.
Program Files\Adobe\Adobe After Effects \Support Files\Scripts
- OS X:
/Applications/Adobe After Effects /Scripts
Here’s what the script will do:
- Send your current composition to the render queue
- Start the render queue
- Open and focus Photoshop
- Open the previously rendered file
Understanding the code
Render and Send to Photoshop repository is hosted on Github so you can see the code behind it. It is written in CoffeeScript which helps keeping code clean and light. We’ll cover integrating CoffeeScript with ExtendScript in an upcoming article.
Although the script contains some boilerplate code to keep the function scope clean, it could be resumed to three lines.
activeItem (this is our currently opened composition) to the render queue and saving the renderQueue item to a variable.
outputFile = app.project.renderQueue.items.add(app.project.activeItem);
Starting the render queue
Sending our previously saved variable
outputFile‘s file path property to Photoshop.
Although the script is very simple, it will make exporting a gif from After Effects take two operations instead of five. This can make a pretty big difference at the end of the day.
The script being on Github also allows anybody to contribute, if you feel that you can improve it go ahead and submit a pull request!
Written by Sébastien Lavoie (Published articles: 16)