Custom script for render queue

What type of scripts do you need?

Moderator: byronnash

Post Reply
Posts: 1
Joined: July 20th, 2010, 9:19 am

I was wondering if anyone could help me with this: I need a script that I can use to replace the "add to Render Queue" shortcut that does just one additional thing for me: automatically checks the pixel height of the comp I'm adding to the render queue, and if it is below 32 pixels high, uses an uncompressed QuickTime output module, otherwise leaves the output module as the default lossless. This is for After Effects CS5.

Basically, we use After Effects to create animations for LED ribbon boards at stadiums/arenas around the country, that get played back as AVI files through custom software. In CS5, any animations that are less than 32 pixels high have black added to them top and bottom to reach 32 pixels automatically and silently if they are rendered to AVI. Our solution is to render those animations to Quicktime, which in CS5 supports heights as low as 16 pixels. We then have to use a 32bit program like Quicktime itself, or CS3, which do not have the pixel height limitations in them, to convert these Quicktimes to AVI for final playback. However, since not all the boards we render for are below 32 pixels, and After Effects does not generate a prompt warning about the pixel height mismatch, but changes things silently, We need something that will automate the output modules for us, so that if the animation is too short heightwise to render to AVI, it automatically changes the render settings to Quicktime. I already have a batch file that zips and moves the rendered .AVI files, so if any quicktimes are left in the render folder, it will be obvious that those need to be converted to AVI, but I can't rely on designers to always remember that the 1 or 2 boards they are rendering out of 10-15 custom sizes for a venue are below 32 pixels high, and need a separate render module, and the software does not properly display the AVI's if they are rendered to the wrong height.

Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Here's a basic script that does what you asked. You just need to change the bit that says Alpha Only on the first line to the name of your Quicktime template.

Just save it as a text file with a .jsx extension and put it in your Scripts folder. I guess ideally it would have a UI with a "Add to Render Queue" button but that's a (little) bit more work.

You could also look into assigning a keyboard shortcut to running the script: ... o-scripts/

Code: Select all

	var QTtemplate = "Alpha Only";
	var activeItem = app.project.activeItem;
	if (activeItem != null && activeItem instanceof CompItem) {
		var theRender = app.project.renderQueue.items.add(activeItem);
		if (activeItem.height < 32) {	
	} else {
		alert("Select the comp you want to render first");
Post Reply