For some reason this script works on some computers but not others. On more than one computer it's added the files to render queue but then stops (doesn't render anything) and puts "Needs Output" under "Output to:". Works fine on my computer. Have any idea why this would behave like that?
Using CS3 on OSX.
Thanks!
Matt Kuebrich
Code: Select all
//See if we've saved a default for the composition name to use as a user prompt
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 = ""; //prompt that will display when dialog appears; set to nothing
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
}
//Prompt user for name or string to populate Render Queue
// searchString = prompt("What string to render?", searchString);
searchString = "qqq"
//Go through all items in Project, for all items that are compositions, see if the name string matches
if (searchString) { //If the user pressed "Cancel" searchString will be undefined
app.settings.saveSetting(sectionName, keyName, searchString);
searchString = searchString.toLowerCase();
for (i = 1; i <= app.project.numItems; ++i) { //for/next loop goes through all Items
var curItem = app.project.item(i);
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
app.project.renderQueue.items.add(curItem); //add item to the Render Queue
}
}
}
app.project.renderQueue.showWindow(true); //bring the RQ window to the front
}
//Prompt the user for a new folder location
var newLocation = folderGetDialog("Select a render destination...");
//Set active RQItems to render to the new location
if (newLocation) { //boolean to see if the user cancelled
for (i = 1; i <= app.project.renderQueue.numItems; ++i) {
var curItem = app.project.renderQueue.item(i);
if (curItem.status == RQItemStatus.QUEUED) {
for (j = 1; j <= curItem.numOutputModules; ++j) {
var curOM = curItem.outputModule(j);
var oldLocation = curOM.file;
curOM.file = new File(newLocation.toString() + "/" + oldLocation.name);
//alert(curOM.file.fsName);
}
}
}
}
//render
var myQueue = app.project.renderQueue //creates a shortcut for RQ
// Call render
myQueue.render();