NetRexxScript Version 0.1.3  (November 30 2009)
By Kermit Kiser (nrs@kermitkiser.com)
Introduction

The "NetRexxScript" plugin adds support to jEdit for running scripts, macros, and programs written in NetRexx.

Requirements

The minimum (known) requirements are:

Note that this is a "beta" release: it is still being tested and it may work with other Java and jEdit versions or other operating systems but these are the only tested environments at this time. I will adjust these requirements if anyone tests the plugin under different environments and reports success or failure there.

Installation

The 0.1.3 version can be installed from the jEdit Plugin Central site via the jEdit plugin manager. Select "Plugins" => "Plugin Manager" => "Install", mark the NetRexxScript plugin and click the "Install" button.

If NetRexxScript is not available from Plugin Central for some reason, you can install it manually:
Getting Started and using NetRexx Scripts

The plugin will start automatically when jEdit starts. The plugin will create a "NetRexx" subdirectory under the user account's jEdit macros directory and copy any sample scripts bundled with the plugin there. You can save your NetRexx scripts in either directory depending on where you want them to appear in the Macros menu. They must be ".nrx" files for the plugin to handle them. Select them from the macro menu to execute them.

If the option called Prefix ("add jEdit variables") is turned on, the plugin will add the default jEdit macro variables to the start of the script (see below). If the option is turned off, the plugin does not alter the NetRexx scripts - they are passed unchanged to the interpreter. If the first line of your script is an import, options, package, or class instruction, the plugin will not add the jEdit variables even if the add option is turned on. In that case if you need the variables described in the jEdit beanshell guide to writing macros, you must create them yourself by adding something like this to the beginning of your macro:

-- These are the lines added automatically by the default "Prefix" option:

    import org.gjt.sp.jedit
    view=jEdit.getActiveView()
    buffer=view.getBuffer
    wm=view.getDockableWindowManager()
    editPane=view.getEditPane()
    textArea=editPane.getTextArea()
    scriptPath=jEdit.getProperty(String "NetRexxScriptPath")

You can change the automatic prefix lines by altering the "prefix.txt" file in the NetRexx directory in the jEdit profile directory (not the one under the macros directory). *** Do not add any "new line" characters or the error reporting back to the original files will be broken! ***

You can add NetRexx scripts to the jEdit startup directory but they must start with an import, options, package, or class instruction if the prefix option is on in order to prevent access to jEdit variables that don't yet exist such as a "view". There is currently no provision to save or pass objects from startup scripts.

All errors, traces, debugging info and std output currently go to the activity log (Utilities>Troubleshooting>Activity log to see any error messages if things don't work.). Parse errors will be reflected to the script as colored underlines and to the error list window. When debugging scripts, it is strongly recommended that you open the NetRexxScript plugin's dockable window and dock it top or bottom. This will give you windows to see output from the script, trace output, and interpreter parse output as well as to interact with scripts from a command line console.

Options
Advanced Usage

If you have scripts which are very stable, you can compile them into Java class files via nrc, NetRexxJe, Ant, etc and NetRexxScript can then execute them directly from the class files without needing to parse them. This can greatly improve script performance. The class files can be executed from the console command line by entering the class name or from the Macros menu if you place them in a jEdit macro directory. Note these items if using this feature:

Feedback

Please send any bug reports or feedback to me at the following address
nrs@kermitkiser.com

Thanks
Kermit Kiser