what kind of a text file?
you can use a dataURL or an unknown mime type to trigger a file download. maybe this comes from an extension (don't remember) but you can associate certain MIME types with certain actions.
if you associate your unique mime with "always save"ing the file, you can effectively save to the HD w/o intervention (other than the first time).
//fake data that could be from a form or whatev:
var formData={age: 21, name: 'fred'};
//a serialized version of that data for saving:
var strData= formData.name+" is "+formData.age+" years old.";
// build a virtual file url:
var url="data:text/something-new," + escape(strData);
//download the "file" by opening the url:
window.open(url);
don't forget to customize and remember your save/open action the first time it runs.