I have just released a beta version of a Perl scripting plugin. The files can be found here.
In accordance with the Perl motto (“There’s More Than One Way To Do It”), the plugin has a simple interface for registering scripts and events, but also allows script authors to create their own custom objects to do the job if they prefer.
The plugin comes with a help file available from Extensions|PlPN|Help, which should get you started.
In addition to the main project file, some example scripts are available for download, and so is the HTML documentation used to generate the CHM file.
I hope to implement the following features in future versions:
A macro recorder. (Most of the structure to allow one to be written in Perl is in place, but I still need to make some final tweaks, determine a good storage format, and then actually write the Perl code.)
Enhanced functionality for the Document object (in the form of wrappers around the SendEditorMessage function).
An installer file (currently it’s only available as a zipped archive).
Until now, only my eyes have seen it, so it needs some serious stress testing. While there is a good deal of XS glue, I have tried to keep most of the logic in Perl itself, so other Perl programmers can help find and fix bugs.
Well, I can’t seem to figure out how to install the plugin — perhaps you can write a guide on that? I get cryptic error messages complaining about perl path but wouldn’t let me set it up after the first time it asked for it. Does it store the configuration settings somewhere outside the PN directory?