mutyalarao:
--------------------------------------------------------------------------------
Hi All,
I would like to develop an extension for PSPad. Is there any guide for this? In
what language I can develop?
Thanks,
Rao.
--------------------------------------------------------------------------------
Hi,
Check the help file for scripting reference:
...\PSPad\Script\readme.rtf
there are also script files already (both sample and real ones) in the
respective subdirectories
...\PSPad\Script\...
There is also the respective part of the PSPad Help:
Customize PSPad :: Script
I believe, you can use any language, which is available via Windows Script Host
(WSH) on your computer.
The most accessible might be JavaScript od VBScript.
It can be as simple as the following javascript - you assign an unique name to
the script file and a version number
then you need the function definition as usual in the given language
if (editorsCount()<1){return;} - aborts the script if called with no text tabs
open in PSPad - as this script will only work on some text content
var actEd = newEditor(); - creates new Editor instance
actEd.assignActiveEditor(); - assignes that to the current text tab
runPSPadAction("..."); and actEd.command("..."); just call internal PSPad
functions - for simplicity - there could as well be some program logic - string,
regexp, date manipulation ... also with multiple "intermediate" functions etc.
To add the item in the scripts menu and possibly assign a keyboard shortcut for
it, the Init function is used
function Init(){
addMenuItem("join and copy", "", "joinAndCopy","Ctrl+Alt+Shift+J");
}
... menu text, optional menu folder (empty for toplevel menu), function-name,
optional shortcut
HTH,
vbr
////////////////////////////////////////////////////////
// save e.g. as ... PSPad\script\JScript\joinCopy.js ///
var module_name = "joinCopy";
var module_ver = "1";
function joinAndCopy(){
if (editorsCount()<1){return;}
var actEd = newEditor();
actEd.assignActiveEditor();
runPSPadAction("aJoinLine");
actEd.command("ecLineStart");
actEd.command("ecSelLineEnd");
actEd.command("ecCopy");
}
function Init(){
addMenuItem("join and copy", "", "joinAndCopy","Ctrl+Alt+Shift+J");
}
--
<http://forum.pspad.com/read.php?6,57481,57501>
PSPad freeware editor http://www.pspad.com