← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #688862]: how to switch each instance after creating multiple app install

 

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

Description changed to:
Now, I use 2.0.2 version.
I want to create some instance for notpad and switch active between these instance.

myApp = App("C:\\Windows\\system32\\Notepad.exe")
myApp.open()
type("1111")
myApp.open()
type("2222")
sleep(5)
print myApp.hasWindow()   -> always false

temp = App("Notepad")
print temp .hasWindow()    -> always false

as the plan, I want to refer the following code to switch each installed. but hasWindow() is false.
for n in range(100):
        w = myApp.window(n)
        if not w: break # no more windows
        w.highlight(2) # window highlighted for 2 second

so it can not work, I change another way, App.focus("Notepad.exe",0), but there is the following error.
it seems not work, it does not change front

how to use it?
thanks

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.