Page 1 of 1

Script for Watch Folder Automation

Posted: February 13th, 2013, 12:34 am
by Drumper

Im trying to create a script that automates the "collect files" function for the watch folder and i have some problems. Maybe some of you can give me some tips.

I study what after effects is doing when i create a collected folder:
- its creating a new folder with the same name as the project
- its creating in this folder the after effects file, and two text files.
- (if you activate collect items then it will create a footage folder, but i dont need that)

One of these TXT Files is the RCF (render control file). It looks like it doesnt need the second TXT File for starting the render in the watch folder

Ok, so i thought, i would recreate these steps per script:
Creating a folder:

Code: Select all

var myFolder = new Folder(theFolder);
-> works

Saving the after Effects File into that folder:

Code: Select all

var myRenderSave = File(newFile);;
-> works

Create the TXT File with the RCF informations:

Code: Select all

var myFilePath = "myFolder+"/"+newFile+"_RCF.txt";
                        var myFileTXT = new File (myFilePath);
                        myFileTXT.lineFeed = "windows";
                        myFileTXT.writeln("After Effects 11.0v1 Render Control File");
-> works

Everything is looking good so far. It looks like the folder AE is creating by "collecting files"... But it doesnt work!

Does the TXT File has to be in a special format? If yes, how can i do that?
Do i oversee something? if that works, it would be a great workflow optimizer for our production - Per one click i could send renderjobs to our renderserver.

thx for any tips!

Re: Script for Watch Folder Automation

Posted: February 16th, 2013, 6:41 am
by Drumper
no one? :(

Re: Script for Watch Folder Automation

Posted: February 19th, 2013, 7:57 am
by drockne
This might be a silly question, but why do you need the text file? Won't your AE file have all the needed render settings? Also if your project doesn't have any footage, why does it need to be collected?

Re: Script for Watch Folder Automation

Posted: February 20th, 2013, 11:58 am
by Drumper
So far i know does the after effects watch folder function need the txt file to pick up a job. if there is no rcf file the watch folder just hops from project to project but says "no render controll file found" or something like that.
Or do you know another way? maybe some adjustments in some settings?

Re: Script for Watch Folder Automation

Posted: February 21st, 2013, 12:20 pm
by drockne
Personally, I've never had much luck with watch folders. It seems that you need to do a full collect files process for it to work. Maybe the issue isn't your text file but instead the fact that you aren't collecting footage files?

I don't use watch folders, instead I have a script that writes a command line command to render the file with the aerender node. This is nice because I can create a .command file with that command in it, then run additional commands afterwards. For example: The command renders the video once in animation codec, then run a compression program to create a deliverable as well as web preview copy.

One possible option for you is to use socket connections to communicate to your render machine. Rather than have it waiting for files to get dropped into this watch folder you could send signal through a socket connection to tell it where to find the file to render. Just some thoughts. Best of luck!

Re: Script for Watch Folder Automation

Posted: February 23rd, 2013, 12:28 am
by Drumper
Hm, i know what you mean with "no luck with watch folder" - its not really reliable.
Which script do you use for the commandline renderer? i have no clue of that commandline thing :) maybe you could give me a quick overview?
sadly, i have no experience with socket connections. maybe a good url to learn?

Thx for your tips :)

Re: Script for Watch Folder Automation

Posted: February 25th, 2013, 8:16 am
by drockne
There are two PDF's from Adobe that cover most of what there is to know about scripting with aftereffects. The last link shows you how to launch an AErender node from the command line. Basically what I ended up doing was writing a text file that had my command line command in it, saving it as a '.command' file, then using the callSystem method (on page 169 of the AE scripting guide) to escalate the permissions of that command file so it's treated as an executable. Then I use the same callSystem method to run the command file.

The reason I jump through all those hoops rather than just running the render command directly from after effects is because after effects will stop and wait for the results of anything you send via callSystem. So it would halt AE until it was done rendering the file.

Lastly, I haven't done anything with socket connections, so I can't give you much advise there except to start looking at page 194 of the Javascript Tools Guide (second link below). ... _guide.pdf ... _guide.pdf ... 79a3a.html

Re: Script for Watch Folder Automation

Posted: February 26th, 2013, 4:54 am
by Drumper
Thx for your information. I will study them. BTW: there is already a new Scripting Guide out there - for CS6: ... -Guide.pdf

i will come back when i study your infos.


Re: Script for Watch Folder Automation

Posted: December 15th, 2017, 3:39 am
by berniebernie
i know this 4 years old but in case someone comes across it and still uses watchfolder as a cheap renderfarm I think I have a solution; i'm fairly sure AE is being a little bitch and not picking up projects that have too long a name or funky characters

basically your aep filename should be (as far as I can tell) less than 20 characters long (so your _RCF.txt file 24 characters). Folder names don't matter as far as I can tell. If I use aerender.exe it tells me there's a file permission error but standard afterfx.exe" -m -re -wf "c:\path\to\watchfolder" works