← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #183901]: If an application has multiple windows, how can I bring anyone of them onto the most front of the screen?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- Windows
Here it is possible to select an opened app window by knowing some part of its window title text.
Using switchApp("some text") or App("some text").focus() will bring the respective window to front, if it contains "some text" in its window title. 
You have to play a little bit around with it, to find out what is best for your situation.

--- Mac
The solution on Mac behind switchApp() and class App is different to Windows. Here you access a process with these functions, which could have multiple windows open. You will not get any information from  Sikuli, which of these windows is frontmost and Sikuli on Mac has no feature to make a specific window the frontmost.
Here you have to either simulate mouse actions/key strokes to handle the windows or use AppleScript from Sikuli (call a script using os.popen("osascript ...") to tell a specific window to come to front.

If not already done, it is of value to read through the doc chapter:
http://sikuli.org/docx/globals.html#controlling-applications-and-their-
windows

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