The core of the jEditLauncher package is a COM component that can communicate with the EditServer, or open jEdit if it is not running or is otherwise refusing a connection. The component supports both Windows and UNC file specifications, including wild cards. It will resolve shortcut links to identify and transmit the name of the underlying file.
Because it is implemented with a “dual interface”, the functions of jEditLauncher are available to scripting languages in the Windows environment such as VBScript, JScript, Perl (using the Win32::OLE package) and Python (using the win32com.client package).
The scriptable interface consists of two read-only properties and six functions:
Properties
ServerPort - a read-only property that returns the port number found in jEdit's server file; the value is not tested for authenticity. It returns zero if the server information file cannot be located.
ServerKey - a read-only property that returns the numeric authorization key found in jEdit's server file; the value is not tested for authenticity. It returns zero if the server information file cannot be located.
Functions
OpenFile - a method that takes a single file name (with or without wild card characters) as a parameter.
OpenFiles - this method takes a array of file names (with or without wild card characters) as a parameter. The form of the array is that which is used for arrays in the scripting environment. In JScript, for example the data type of the VARIANT holding the array is VT_DISPATCH; in VBScript, it is VT_ARRAY | VT_VARIANT, with array members having data type VT_BSTR.
Launch - this method with no parameters attempts to open jEdit without loading additional files.
RunScript - this method takes a file name or full file path as a parameter and runs the referenced file as a BeanShell script in jEdit. The predefined variables view, editPane, textArea and buffer are available to the script. If more than one view is open, the variable are initialized with reference to the earliest opened view. If no path is given for the file it will use the working directory of the calling process.
EvalScript - this method takes a string as a parameter containing one or more BeanShell statements and runs the script in jEdit's BeanShell interpreter. The predefined variables are available on the same basis as in RunScript.
RunDiff - this method takes two strings representing file names as parameters. If the JDiff plugin is installed, this method will activate the JDiff plugin and display the two files in the plugin's graphical “dual diff” format. The first parameter is treated as the base for display purposes. If the JDiff plugin is not installed, a error message box will be displayed in jEdit.