Im new to ae scripting, i really like the stuff im seeing here, its very nice.

Idd like to have the posibility to convert large amounts of avi files from HD to SD. I started off with a script and it does convert all my comps. But i really like to automate it further. Can someone help me or point me in the right direction?
Thx in advance
Treewhiperer
Here is the script
Code: Select all
//based on renderNamedItems
//To do
//user defines render location
//each avi file will be placed in a comp and added to renderque
var sectionName = "AE Example Scripts"; //Groups together keys into a section, stored in Prefs file
var keyName = "Render comps with this string"; //A useful way of labelling what data we've saved
var searchString = "";
var OPmodule = "SDcodec"; //Template
if (app.settings.haveSetting(sectionName, keyName)) { //Look in the prefs file to see if settings exist
searchString = app.settings.getSetting(sectionName, keyName); //If so, set the variable to existing
}
for (i = 1; i <= app.project.numItems; ++i) { //for/next loop goes through all Items
var curItem = app.project.item(i); // get each video item and place it in a comp
/*compName = curItem.name;
compWidth = curItem.width;
compHeight = curItem.height;
app.project.items.addComp(compName, compWidth, compHeight, 1.0, 1, 25);*/
addtoQueue();
}
function addtoQueue(){
if (curItem instanceof CompItem) { //test if current item is a composition
if (curItem.name.toLowerCase().indexOf(searchString) != -1) { //test if string exists in comp name
var tempQ = app.project.renderQueue.items.add(curItem); //add item to the Render Queue
try{
tempQ.outputModules[1].applyTemplate(OPmodule);
}
catch(e){
alert("Please Load the Required Templates \n Located here - snap5 - bucket1 - admin - Expressions_Etc \n\n" + e.toString())
}
}
}
}