Page 1 of 1
Execute() not available in micromacro?
Posted: Sat Apr 24, 2010 12:32 pm
by Sgraffite
I'd like to make a script that can run an executable, attach to the process, close the process, and repeat.
I didn't see anything in the micromacro documentation about running an executable, so I checked the lua docs. I came across the execute() method, but it appears it is not implemented in micromacro?
Is there any way to run an executable using micromacro?
Re: Execute() not available in micromacro?
Posted: Sat Apr 24, 2010 6:22 pm
by Administrator
The function you are looking for is os.execute(), not just execute(). However, you might also consider using the
system() function (from MicroMacro's library functions). There is only a slight difference between these. system() is better for command-line programs you will "return" a value you want.
Re: Execute() not available in micromacro?
Posted: Sun Apr 25, 2010 11:09 am
by Sgraffite
Thanks, I was able to get both of those to run the application. However, both os.execute() and system() appear to wait for the application to finish before continuing on. I'd like to be able to send keystrokes and mouse events to the application after it starts up.
Is there a way to make it so that micromacro does not wait for the application to complete?
Re: Execute() not available in micromacro?
Posted: Sun Apr 25, 2010 9:34 pm
by Administrator
Code: Select all
os.execute("START theprogram.exe");
This will not work with system(), as the whole point of that function is to wait till the program ends so that you can read it's output.
Re: Execute() not available in micromacro?
Posted: Mon Apr 26, 2010 10:45 pm
by Sgraffite
Awesome, that works great
