Is it possible to put a variable in an output path?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
nesanime
Posts: 2
Joined: March 6th, 2007, 12:20 pm
Location: Montreal

Hi all:

I'm trying to learn some scripting to simplify some tasks at job.
In the pipeline we have folders with the names of every shot, but the rest of the path is the same. Then I was wondering if I name my comp with the same name that my folder in the network, and i could copy that in my path, then my outputs would be fine.
I will put an example to try to explain me better:

Shot name: lin05
Comp name: lin05
Path name: D:\3D\Lin\lin05\render\

I copy this from an adobe forum to set the render (only one comp in the project and in the first place of course) and i try to modify it a bit:

myComp = app.project.item(1);
myRQItem = app.project.renderQueue.items.add(myComp)
myRQItem.outputModule(1).file = new File("D:\3D\Lin\(app.project.item(1).name)/[compName].mov");

And of course didn' t work...

I try also with [compName] and same result...

Any suggestions for that? Can I set a variable in the path in some way?

Thanks for all your help in advance!!!

I hope i explain clear enough because it wasn' t easy

:wink:
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

Hi nesanime,

You need to concatenate the parts of the file name with something like:

myRQItem.outputModule(1).file = new File("D:/3D/Lin/" + myComp.name + "/[compName].mov");

Note that I've also changed the backslashes to forward slashes, otherwise you'd need to "escape" them as double backslashes (\\).

Hope this helps.

Jeff
nesanime
Posts: 2
Joined: March 6th, 2007, 12:20 pm
Location: Montreal

Hi Jeff,

Thank you so much. It was exactly what I was looking for...You save me a lot of time with your answer!!
Really appreciated!!

Nestor
Post Reply