Question about Exec() command parameters

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 23
Joined: Sun Nov 13, 2011 5:40 pm

Question about Exec() command parameters

Post 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.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post 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")

Offline
Posts: 23
Joined: Sun Nov 13, 2011 5:40 pm

Post 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:
Post Reply