function save_txt()
{//win是主网页对象,window是当前模式窗口对象,自动在桌面新建一txt文件夹,并创建临时文件名保存成txt.
for (var forI = 0; forI < win.document.all.length; forI++)
{
try
{
if (win.document.all[forI].style.display == "none")
win.document.all[forI].outerHTML = "";
}catch(e){}
}
var text = win.document.selection.createRange().text;
if ( "" == text)
{
document.title = "未有选中文字.";
return 0;
}
var fso, f, r
var ForReading = 1, ForWriting = 2;
fso = new ActiveXObject("Scripting.FileSystemObject")
var path = new ActiveXObject("WScript.Shell").SpecialFolders("Desktop") + "/txt";
if (!fso.folderExists(path))fso.CreateFolder(path);
path = path + "/" + fso.GetTempName().split(".")[0] + ".txt";
f = fso.OpenTextFile(path, ForWriting, true,true)
f.Write(text);
f.Close();
fso = null;
window.close();
}