I've looked through the scripting guide, but can't find anything about this (I must be looking in the wrong places).
Is it possible to pass arguments to a .jsl file? For example, if I had a directory full of addins, and wanted to register them, can I write a Windows batch file that will retrieve each addin filename and pass it to a script that will register that addin?
Hey, Jeff -
Thanks for the reference. That solution, while a bit elaborate, seems like a good way to go. Now...what about invoking a .bat file from within a .jsl script, and passing parameters to it?
You might have to dymanically generate a .bat or .cmd file that calls your main bat file. Something like this:
p1 = "Hello";
pt = "World";
cmd_file_text = evalinsert("C:\myprogs\mainbatfile ^p1^ ^p2^");
cmd_file = "c:\TEMP\tmprun.cmd";
// Write this file out to a known file location
save text file(cmd_file, cmd_file_text);
// Now execute the command file
Thanks, PMroz. As a side question, why is it that EvalInsert isn't listed in the scripting index? I've noticed on other occasions as well that there seem to be quite a few undocumented features that I should know about. Is there a more comprehensive list of functions/features available somewhere?
One more (actually, two) question in this general vein, if you please:
The script that I'm modifying uses open() to invoke command files.
1. is this a good way to do this? I ask because the scripting index provides 5 examples of open() but none of them involve command files.
2. how can I get an exit code from the command file? The file in question takes two pathnames as arguments (solved above) and compares their revision dates. I'd like to do something with the exit code like:
1 if the first file is older
0 if the file dates are the same
-1 if the second file is older
And use the exit code within my .jmp script for further action. Any ideas on this one?
Thanks for the assistance.
EDIT: I realize this is a bit off the subject of the original post; should I create a new thread for these questions?