Re: Clip to Text File
Reply #3 –
Since you asked in the Tool Forum, here's a tool.
I named this: To NotePad.vbs
Use the command: wscript "Scripts\To NotePad.vbs"
Option Explicit
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Dim f: f = fso.GetBaseName(fso.GetTempName) & ".txt"
f = fso.BuildPath(fso.GetSpecialFolder(2), f) ' 2 = %TEMP%
fso.CreateTextFile(f).Write(WScript.StdIn.Read(46080))
CreateObject("WScript.Shell").Run(f) ' leaves %TEMP%\nwt*.TMP
WScript.Sleep 500: fso.DeleteFile(f)
On Error Resume Next
For Each f In fso.GetSpecialFolder(2).Files
If Left(f.Name, 3) & Right(f.Name, 4) = "nwt.TMP" Then f.Delete
Next
If WScript.StdIn.AtEndOfStream Then WScript.Quit
MsgBox "Truncated to 45K bytes", vbExclamation, "Warning"