… and you can then complile those into whatever type you choose from the compiler menus, but with the option to have them as separate files. (Yep, some people use Scrivener to organise their code…)
If the intention is to produce source code files, then (a) plain-text is going to be what you want to compile with and (b) you probably won’t mind rolling up your sleeves and adjusting a post-processing script to do what you want. If so, give this a try. The example was provided for someone looking to produce multiple .tex files upon compiling, but it would be a very simple matter to tweak the Ruby script to split and output unprocessed txt files.
Get that set up in a way that works for you, and you’ll be able to compile a folder full of files with no more than a click.