← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #210732]: How do I know if a specified script (skl) is finished?

 

Question #210732 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/210732

    Status: Needs information => Open

Fightsea gave more information on the question:
Dear SIKULI members,

Yes, the word "sequentially" I mean is one after the other.

I develop my own Win32 APP Tool under C# environment.

Setup:
1. Insatll SIKULI-IDE.
2. Under 32-bit Windows environment, assiociate *.skl extension with "Sikuli-IDE.exe".
   (Set "Sikuli-IDE.exe" as default launching program with *.skl extension)

After 1+2, we can do below things:
(a) We can directly run *.skl under Command Lind (CMD) window.
(b) We can create new Process(xxx.skl) and let it run under C#.
    (refer to http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx)

And here is my problem:
If we directly run xxx.skl under CMD line, the command will return immediately.
In other words, C# API Process.WaitForExit() also returns immediately.

But actually the script is just starting working (e.g. Open some window and do some mouse activeties).
The "reurns immediately" make us cannot catch the actual timing when the script finishes its job.

And it causes all *.skl launched at the same time, not "sequentially"
launched.

The C# code may look like this:
for (each xxx.skl files)
{
    Process runSkl = new Process();

    runSkl.StartInfo.FileName = "xxx.skl";
    runSkl.Start();

    runSkl.WaitForInputIdle();  // return immediately
    runSkl.WaitForExit();  // return immediately

    runSkl.Close();
}


Best Regards,
Fightsea

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.