<http://forum.pspad.com/read.php?f=2&i=12229&t=11849> 
----------------------------------------------------------------

Hi:

Sorry to bump this old post, but I found a solution to this problem using
the scripting feature and I wanted to share it in case others come across
this topic while searching for a solution to a similar problem.

I like this idea of supporting external scripting engines. It adds a lot
of power and flexibility to PSPad.

The script is shown below.

Garvan


''-------------------------------------------------------------------------
'' util.vbs
'' PSPad add in script to run external code beautifier in project mode
'' GOK, 2006-03-14
''-------------------------------------------------------------------------
option explicit

const module_name  = "Util"           '' this name must be unique
const module_ver   = "0.1"            '' version

sub RunFBStyle
    dim utilname, GetFileName
    dim editor, wshShell, SH

    utilname =
"D:\FreeBASIC_Projects\projects\Archive\FBStyle\FBStyle.exe"
    On Error Resume Next              '' dont display errors
    Set editor = newEditor()
    editor.assignActiveEditor
    editor.saveFile
    GetFileName = editor.fileName
    utilname = utilname + " " + GetFileName
    Set wshShell = WScript.CreateObject ("WSCript.shell")
    wshShell.run utilname, 0, true
    wshShell.AppActivate "PSPad"
    Sleep(100)
    wshShell.SendKeys "^r"  '' Ctrl r == refresh
end sub

sub Init
    addMenuItem "FBStyle","", "RunFBStyle"
end sub

[%sig%]

-- 
PSPad freeware editor http://www.pspad.com

Reply via email to