#!/bin/bash

# AERenderRQIndexSequence Script To Render After Effects Compositions in OS X
# by Brian Obee
# 
# This script will render After Effects compositions using their RQIndex numbers, the numbers they are listed by in the Render Queue.  
# Each render will appear in its own terminal window
# The script will generate separate .command files for each composition and run them.
# Double click a .command file to run is separately




# PROJECT
# Set the path and name of the After Effects script here….

AEP=/data/projects/161214_RoseRabbitLie/aep/TCOLV_RRL_170102.aep


# RQINDEX START
# Set the RQIndex number to start with…

START=1



# RQINDEX END
# Set the RQIndex number to end with…

END=7



##############################################
#######  DON’T CHANGE ANYTHING BELOW
##############################################



#change the working directory to the one the script is run from….
cd -- "$(dirname "$BASH_SOURCE")"




for ((i=$START;i<=$END;i++))
do
echo \#!/bin/bash > rqindex${i}.command
echo /Applications/Adobe\\ After\\ Effects\\ CC\\ 2015.3/aerender  -v ERRORS_AND_PROGRESS -project $AEP -rqindex $i >> rqindex${i}.command
chmod +x rqindex${i}.command
sleep .5
open rqindex${i}.command
done












