You are here: PSPad forum > English discussion forum > Re: First steps on extension writing

Re: First steps on extension writing

#1 First steps on extension writing

Posted by: psiciliano | Date: 05/12/2017 18:52 | IP: IP Logged

Hi!

I'm trying to write my first PSPad extension, I wish it will be to execute some batch tasks based on a configuration file and a project select. I'm doing it at first for windows. I'm writing it in JS.

I've read this: namingexception.wordpress.com, It's great and works fine. And I've modified this tutorial to run a shell command with this code:

var oShell = new ActiveXObject("Shell.Application");
var iRetVal = oShell.ShellExecute("my_command.cmd", "", "", "open", "1");

But I can't capture the shell command output. How can I do it?

Second question is ... There is any way to interact with an html document in a plugin as user interface?

Thanks for any answer.
Pablo.

Options: Reply | Quote | Up ^


#2 Re: First steps on extension writing

Posted by: vbr | Date: 05/13/2017 11:46 | IP: IP Logged

psiciliano:
Hi!

I'm trying to write my first PSPad extension, I wish it will be to execute some batch tasks based on a configuration file and a project select. I'm doing it at first for windows. I'm writing it in JS.

I've read this: namingexception.wordpress.com, It's great and works fine. And I've modified this tutorial to run a shell command with this code:

var oShell = new ActiveXObject("Shell.Application");
var iRetVal = oShell.ShellExecute("my_command.cmd", "", "", "open", "1");

But I can't capture the shell command output. How can I do it?

Second question is ... There is any way to interact with an html document in a plugin as user interface?

Thanks for any answer.
Pablo.

Hi,
if the variable iRetVal refers to the return value you are interested in, you can display it in the log panel in PSPad
try:
logAddLine(iRetVal);
Check other available scripting functions in the documentation in the program directory of PSPad
...\PSPad\Scripting.rtf

Regarding the second question, I don't know of any internal functionality for interacting with html pages - this may be possible using ActiveXObject, but for use as gui for PSPad scripting, there might be problems with blocking, handling focus etc. (My brief attempts in similar area (using python and tk for gui in PSPad) led to problems of this kind, but it might be doable.)

hth,
vbr

Options: Reply | Quote | Up ^


#3 Re: First steps on extension writing

Posted by: psiciliano | Date: 05/14/2017 13:12 | IP: IP Logged

Thanks!

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2017 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák