View previous topic :: View next topic |
Author |
Message |
foliator
Joined: 13 Nov 2011 Posts: 23
|
Posted: Tue Nov 13, 2012 6:49 pm Post subject: Question about Exec() command parameters |
|
|
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. |
|
Back to top |
|
 |
KDJ
Joined: 06 Mar 2010 Posts: 1929 Location: Poland
|
Posted: Tue Nov 13, 2012 8:47 pm Post subject: |
|
|
foliator
You can do this by using the simple script:
Exec_Lookup.js Code: | AkelPad.Exec("Lookup.exe " + AkelPad.GetSelText()); |
Command:
Call("Scripts::Main", 1, "Exec_Lookup.js") |
|
Back to top |
|
 |
foliator
Joined: 13 Nov 2011 Posts: 23
|
Posted: Tue Nov 13, 2012 9:47 pm Post subject: |
|
|
KDJ wrote: | foliator
You can do this by using the simple script:
Exec_Lookup.js Code: | 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.  |
|
Back to top |
|
 |
|