<script language="vbscript"> sub save_as() Set objFSO = CreateObject("Scripting.FileSystemObject") strSaveFileName = InputBox("Please enter the complete path where you want to save your script (for example, C:\Scripts\MyScript.txt).") If strSaveFileName = "" Then Exit Sub End If Set objFile = objFSO.CreateTextFile(strSaveFileName) objFile.WriteLine document.all("code").value objFile.Close end sub </script> <input type="text" id="code"> <br><input type="button" onclick="vbscript:save_as()">
sub save_as()
Set objFSO = CreateObject("Scripting.FileSystemObject")
strSaveFileName = InputBox("Please enter the complete path where you want to save your script (for example, C:\Scripts\MyScript.txt).")
If strSaveFileName = "" Then
Exit Sub
End If Set objFile = objFSO.CreateTextFile(strSaveFileName)
objFile.WriteLine document.all("code").value
objFile.Close
end sub
</script>
<input type="text" id="code">
<br><input type="button" onclick="vbscript:save_as()">