Hello again,
Rather than using the animation tools in C3D to easily accomplish an animated movie of moving objects, it seems you are focused on using javascript… Perhaps the following is a method.
Render your "frames" with your script
Have your script keep count the number of rendered frames.
Upon completion, don't do any more renders until finishing processing this job
Build a list of folders in the Render History folder starting with the newest one, going back the number of frames you've rendered.
Loop through that list, processing each of those folders by saving a copy of the target rendered file as a sequential name in your target folder.
Each folder in the Render History folder, that is the result of a single frame rendering job, only contains three files, thumbnail.png, info.plist, and image.png. You'll want to save a copy of the image.png file, as a unique sequential name, in the folder you have set up to receive the sequential frames for opening in QT Player.
Scripting still seems like a rather obscure/indirect way of creating an animated movie of 3D objects using C3D when decent animation tools are there.
Perhaps C3D's javascript API has features that more elegantly handles your quest. But if you really want to do this with a script, parsing, renaming and moving files seems more like a task for the Finder than it does a task for C3D.
cheers,
gsb