PDA

View Full Version : External links - console app - batch file - .bat - passing param



Comet
12-18-2007, 02:08 PM
Hi,
My title is constructed to be search friendly. The bottomline is that I am trying to link externally to the words.exe (Latin/English) which is a console app - that is on windows, it runs in a command shell (like a "DOS" window).

Most BW users use this tool via a website- the entry in shellexec init file would like like this:

[Latin lookup in WORDS]
Operation = Open
Directory = NULL
File = http://lysy2.archives.nd.edu/cgi-bin/words.exe?<dummy>
Parameters = NULL
MenuLocation = Browse Window Latin
TextType = Latin Text
MapToVersion = NULL
Lookup = Form
MenuText = Latin lookup in WORDS
Enabled = 1

However, I do not have an internet connection at my home, so I have tried something like this to no avail:

[Latin lookup in WORDS]
Operation = Open
Directory = c:words
File = c:\words\words.exe
Parameters = NULL
MenuLocation = Browse Window Latin
TextType = Latin Text
MapToVersion = NULL
Lookup = Form
MenuText = Latin lookup in WORDS
Enabled = 1

The closest I can get to getting it to work is by specifying a batch file that spawns words.exe:

[Latin lookup in WORDS]
Operation = Open
Directory = NULL
File = c:\words\runwords.bat
Parameters = NULL
MenuLocation = Browse Window Latin
TextType = Latin Text
MapToVersion = NULL
Lookup = Form
MenuText = Latin lookup in WORDS
Enabled = 1

My batch file looks something like this:

cd c:\words
words.exe %1

The %1 is the first argument sent to the batch file. It is not getting populated. I can explicitely pass an argument in the Parameters field, e.g.: Dominus. This works, but of course, I want the external links to pass the form of the Latin. I tried specifying <Form> both in the parameters field as well to no avail. At least I can cut and paste the Latin form into the console window, but it would be great if I could get this argument passed.

Anyone know why this doesn't work?
Has anyone successfully gotten the external links to spawn a console app in a command window?

Thanks,
Steve MacKenzie
Bellevue, WA USA

Adelphos
12-21-2007, 11:06 PM
Steve,

I wrote a simple console application and accessed it through the ELM without any problem. Of course, all my app does is print a line of text to the screen, but that shouldn't make any difference if I understand your issue properly. Here are the lines in ShellExec --

//
// External Link #10
//
[Jesus Is Coming]
Operation = Open
Directory = NULL
File = c:\Programming\jesus_is_coming.exe
Parameters = -v <book> <chapter>:<verse>
MenuLocation = Browse Window All
TextType = Bible Verse
MapToVersion = KJV
Lookup = Verse Reference
MenuText = Jesus Is Coming
Enabled = 1

I don't know if you merely made a typo or if your "Directory" line is exactly as you typed it (in your second example), but it looks like that could be part of your problem.

Also, you can play with the "MenuLocation" and "Parameters" variables and see what happens. Try keeping all the variables I have listed and see if that works.

Comet
12-24-2007, 02:49 PM
Sure, I can pass book and verse, but I need to pass "form" (the Latin text that I am right clicking on)

Thanks

Comet
02-19-2008, 07:59 PM
No, the problem must be that the arguments do not get passed in that scenario. Maybe we can have the fellows fix it :)