<http://forum.pspad.com/read.php?f=2&i=11207&t=11207>
----------------------------------------------------------------
I'm running VBS to format my source but when it is copied to my window it
continually adds lines to the bottom. To fix this I tried to use code
similar to this:
editor.command "ecEditorBottom"
editor.command "ecDeleteLine"
Its not working though, here is the code I'm using:
sub Format_Source
set editor1 = newEditor()
set editor2 = newEditor()
set editor3 = newEditor()
editor1.assignActiveEditor
editor1text = editor1.Text
editor2.newFile("C:\Input_Source.txt")
editor2.Text(editor1text)
editor2.saveFileAs("C:\Input_Source.txt")
editor2.closeFile("C:\Input_Source.txt")
command = "C:\Format_Source.vbs"
Set SH = Wscript.CreateObject("WScript.Shell")
SH.Run command, 4, 1
editor3.openFile("C:\Output_Source.txt")
editor3text = editor3.Text
editor1.Text(editor3text)
editor3.closeFile("C:\Output_Source.txt")
editor1.assignActiveEditor
editor1.command "ecEditorBottom"
editor1.command "ecDeleteLine"
end sub
--
PSPad freeware editor http://www.pspad.com