← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #191950]: focus() works the first time only

 

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

RaiMan posted a new comment:
@ Roman
very good points.

It is still so, that the App class does not really hide the system specifics, so the behavior especially of App.focus() is very different on Mac and Windows:
Mac: It is really app switching: You can use the app's name and it gets the active app with focus(), bringing its current frontmost window to the front (the one, that will react on mouse and keyboard). But it is not possible to focus on specific windows using the window title.
Windows: focus() brings a specific window to the front using the window title. Since usually the app name is part of the window title, switching with the apps name might work (but using App("notepad") in german windows always opens a new notepad window, because the window title contains the german app name "Editor").
"appA.open(); appA.focus()" might do what you want, if it is a single window app and only opens once (since you usually have to give the app's path name, which is usually not part of the window title). So you usually have to use 2 different names for open() and focus().

What is really missing currently, is the possibility, to get the window
titles of an apps windows together with some specific information like
"hidden/visible, minimized, fullscreen", so you can deal with the
windows explicitly (make them hidden/visible, minimized, fullscreen,
...). As Roman stated: you can do most of this system specific with
other scripting tools both on Mac and Windows and integrate it with
Sikuli script.

BTW: Hotkeys
Meanwhile the hotkey feature is available with Sikuli and works like a charm.

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