Unfortunately it's not really scriptable as the inode entries are lost. Your only option is to discern from the content what the file is and where it should be linked into the FS tree.
If you know where a bunch should go and need a way to automate this process (ie you can describe exactly what the process should be) then we can script _that_, otherwise it's going to be a long, slow, process sorry
I take it restoring from backup isn't an option?