changePath on outputModule problem.

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
ypar
Posts: 1
Joined: April 25th, 2012, 12:58 am
Contact:

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.
My production notes and updates - mostly AE and C4D: http://productionc4d.blogspot.com
MYX_2000
Posts: 12
Joined: February 6th, 2012, 2:01 pm

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();
Post Reply