Page 1 of 1

changePath on outputModule problem.

Posted: April 25th, 2012, 6:50 am
by ypar
Hello,

I have a script that adds an item to the render queue and then changes the path to a user given directory.
The code is taken out of context:

Code: Select all

var renderQueue = app.project.renderQueue;
var rqitem = renderQueue.items.add(some_composition);
var newPath = "/tmp/test"; // or some other user-given string

if ( rqitem.outputModule(1).file.changePath(newPath) != true  ) 
       alert ("Problem changing path") ;

renderQueue.render();

For reasons unknown to me, the function returns with true, but the render path has not been changed. Can anybody tell me what I'm doing wrong?

Thanks.

Re: changePath on outputModule problem.

Posted: April 25th, 2012, 2:45 pm
by MYX_2000

Code: Select all

// Somewhere near the top of my script I ask the user for a location. I do not place it hard coded into the script as it becomes too rigid. If you ask where the file is to go, there is no need for the if argument.
myFile = Folder.selectDialog(["Where Will We Save the Rendered Files"]);
myPath = myFile.path + "/";

// Assuming that you got the comps into the render quque...

var newFile = new File(myPath + myComp.name );        
QueueComp.outputModules[1].file = newFile;
app.project.renderQueue.render();