Page 1 of 1

Question about Exec() command parameters

Posted: Tue Nov 13, 2012 6:49 pm
by foliator
I've used a couple of dictionary programs that recognize a text string as a command line parameter. They would be very useful in conjunction with AkelPad. Is there a way to use text selected in the editing window as a parameter to be passed to the .EXE file through the Exec() command? So far, the only parameters I have found are %f, %d and %a (file, directory and AkelPad directory respectively).

Here's an example of what I had in mind:

Exec('Lookup.exe "%s"')

where %s is the selected text.

Posted: Tue Nov 13, 2012 8:47 pm
by KDJ
foliator
You can do this by using the simple script:

Code: Select all

AkelPad.Exec("Lookup.exe " + AkelPad.GetSelText());


Command:
Call("Scripts::Main", 1, "Exec_Lookup.js")

Posted: Tue Nov 13, 2012 9:47 pm
by foliator
KDJ wrote:foliator
You can do this by using the simple script:

Code: Select all

AkelPad.Exec("Lookup.exe " + AkelPad.GetSelText());


Command:
Call("Scripts::Main", 1, "Exec_Lookup.js")
Thanks very much for that; it works flawlessly!

BTW, it didn't work at first until I used double backslashes in the external program's path, as I had noticed in some other script. By that you can probably tell that I'm no programmer. :oops: