Automation

SuperEdi supports OLE Automation, which allows you to automate task with SuperEdi by writing customized programs or scripts. There are two ways to automate SuperEdi:

Build-in automation

To automate tasks while you are working interactively with SuperEdi, you can write a script using a scripting language that is supported by Windows Scripting host. To run the script, choose the Tools|Scripts menu to select a script file.

Use the "Folders" page of the Tools|Options dialog to determine the directory where the script files are installed. You can also change this directory if you prefer to edit your own scripts in a different directory.

SuperEdi uses the script file extension to determine the script language. The most common script languages are:

Extension Script Engine
.vbs VBScript (requires Internet Explorer 4)
.js JScript (requires Internet Explorer 4)
.pls PerlScript (see ActiveState Perl)

There are three root objects available:

For example, to display the title of the active document with VBScript, write

Console.WriteLine Document.Title.

Remote automation

You can control SuperEdi from any external program using OLE Automation. This can be useful if you want to run tasks in the background, or if you use batch processing on the command line.

Before you use remote automation, you must first obtain an instance of the SuperEdi.Application or SuperEdi.Document object. This piece of VBScript code will launch SuperEdi, get hold of instance of the Application object and make it visible:

Dim app
Set app = CreateObject( "SuperEdi.Application" )
app.Visible = True