Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call a LA function from a .batfro
#1
Similiar to this thread, I'd like to call a function (accepting a filename as a string argument) by a .cmd script.
I've seen a lot of doc about the reverse direction, but I imagine this will also be possible. Maybe it's alreadyx documented somewhere and I just didn't search well enough?
#2
Create .exe program, and let .bat execute it.

Example. Compile or run this script. When compiling, LA creates C:\Test\LA\cmd1\cmd1.exe.
 
Code:
Copy      Help
// script "cmd1.cs"
/*/ role exeProgram; outputPath C:\Test\LA\cmd1; /*/

if (script.testing) args = [@"C:\Test\test.txt"];

var file = args[0];
dialog.show(file, File.ReadAllText(file));

.bat:
Code:
Copy      Help
C:\Test\LA\cmd1\cmd1.exe "C:\Test\abcg.txt"
#3
Or without .exe.
 
Code:
Copy      Help
// script "cmd2.cs"
if (script.testing) args = [@"C:\Test\test.txt"];

var file = args[0];
dialog.show(file, File.ReadAllText(file));
 
.bat
Code:
Copy      Help
Au.Editor.exe *cmd2.cs "C:\Test\abcg.txt"

To create the command line can be used menu TT -> Script triggers.
#4
Super, thanks very much for that sample!


Forum Jump:


Users browsing this thread: 2 Guest(s)