PDA

View Full Version : Javascript help


ernpchan
10-18-2008, 06:01 AM
I'm in the process of coding a Javascript file to work with our render farm.

What I have setup now is a pop up gui where the animator can type in the specifics (show, episode, shot, etc) of their file. These specifics fill in holes in a network path to define where the path is and where it's being rendered to. I did this because I had to define both PC and OSX paths. We're now only using PC paths so if I could get all this information right out of AE that woudl be great.

How do I get the path to the project that an animator has open?
How do I get the name of the comp/first render queue job?
How do I get the frame length of the first render queue job?
How do I get the output path of the first render queue job?

Thanks.

Ernest

Shinjipierre
10-18-2008, 04:46 PM
alert("file of the project =" + app.project.file);

firstRenderQueueElement = app.project.renderQueue.item(1);
alert("composition name" + firstRenderQueueElement.comp.name);
alert("length ="+firstRenderQueueElement.timeSpanDuration);
firstRenderOutputModule = firstRenderQueueElement.outputModules;
alert("file exported" + firstRenderQueueElement.outputModules.file);

check the scripting guide when you need such things, anyway :
http://www.adobe.com/products/aftereffects/pdfs/aftereffectscs3_scripting_guide.pdf

ernpchan
10-18-2008, 06:34 PM
Thanks Remi!

I've been going through the guide. My trouble is understanding how to use the code properly.

ernpchan
10-18-2008, 07:39 PM
My javascript file is setup like this but it's not working. I only included the sections that I believe are relevant. Is my logic off? I wanna write the information from the AE project file into a bat file that then gets launched with a button.

var Project = app.project.file;
var FirstRenderJob = app.project.renderQueue.item(1);
var CompName = app.project.renderQueue.item(1).comp.name;
var SceneLength = app.project.renderQueue.item(1).timeSpanDuration;
var RenderPath = app.project.renderQueue.item(1).outputModules.file;

var myfile = new XML ( Project + FirstRenderJob + CompName+ SceneLength + RenderPath + PerlPath...

Shinjipierre
10-18-2008, 08:23 PM
new XML ???? Doesn't exist in after effects.... I don't think you're really reading the guide....

you will have to use good old open, write, writeln functions

file = "/c/test.txt";
file.open("w","TEXT","CREATOR");
file.writeln("test");

something like that I guess

ernpchan
10-19-2008, 01:09 AM
I figured it all out and it looks to be working.

Thanks again!

E

CGTalk Moderation
10-19-2008, 01:09 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.