Saving and Loading problems

Ok, so I got saving and loading working pretty well, but how do I save prefabs? What I mean is, I got an array of prefabs created at runtime as the inventory for my character, how do I save out something so that I can get it back later?

How I am saving things is in a text file, and just converting strings to the characters stats and position. Is it possible to get a prefab by the name of it? or is their some other information I can save in text form that I can bring back later to re-instantiate the prefab?

Also: If you load a level that has a script that is still having to run stuff, will it finish off running it? I mean, if I load in the variables, then load in a new level, then set the game to use the variables, will it actually set them?

Im using javascript btw :)

You can load a prefab at runtime using Resources.Load. If you save the name of the prefab in your text file, you could retrieve it with something like

var prefabName: String;  // Obtained from file
var prefab: GameObject = Resources.Load(prefabName);