Rule that modifies content in sub-Spaces

1. Trigger whenever a new Space is created in this Space (via CIFS, but that's neither here nor there)2. In the new Space, transcode a .wmv file to .flv (on the command line, so I'd need to trigger a shell script here and pass it the .wmv file somehow - alternately, define a custom transformer that does its work on the command line)3. Copy the resulting .flv to another server (again with the command line, either via SCP or CIFS, unless Alfresco has some way of transferring files directly via the scripting engine (even copy/export to the local filesystem))4. Change some URLs listed in a config file inside the new Space to reflect the new location of the video

Is this all doable via the JavaScript scripting engine? If someone could point me to some resources to get started I'd appreciate it. Thanks!

#4 could be handled via another command line "transformer" (using bash or perl) I suppose, though having a script triggered by the new sub-Space creation would certainly be cleaner if possible.

I suppose the core problem right for me right now is simply - can I make a rule on a Space trigger when a new sub-Space is created, and pass the name of that sub-Space as a parameter to the various transformers and scripts?