How can I render from within a script?
 
 
 

You can use the system and batchRender commands to render from within a script. For example, you could use the batchRender command as follows:

batchRender -f "absolute path to filename";

Alternatively, you could do the following:

system ("Render -s 1 -e 10 -b 1 absolutepath to filename");

In this case, you would need to do a file save command before issuing that command to ensure that the rendered scene is the most current version.