Get a list of all applications that SikuliX currently sees

Asked by Ben Carson on 2018-02-02

I have an application that is not responding to my_app.focus(). In order to rule out a bad name, I'd like to build a list of every application that Sikulix can detect at runtime. Has anyone ever tried such a thing? I've searched all over the documentation and cannot find any features that allows for this sort of querying.

Thanks,

Ben

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-02-05
Last query:
2018-02-05
Last reply:
2018-02-03
Best RaiMan (raimund-hocke) said : #1

SikuliX does not provide a feature to list apps.

The implementation behind the App class is system dependant:
- on Windows the tasklist command is used internally (no fullscreen apps, only desktop environment)
- on Mac Applescript via osascript is used
- on Linux wmctrl

So you might use these tools, to list the running apps and their windows

Ben Carson (catsandcode) said : #2

Thanks RaiMan, that solved my question.

Ben Carson (catsandcode) said : #3

@RaiMain, Thank you very much for the answer. I have never used the 'tasklist' command before, so I was able to see that my Form has a slightly different name there.
Unfortunately, I am still having the issue where my WinForm isn't being brought to the front with .focus(), however, at this point, I think it's an issue with my application and not Sikulix. I created a new blank form and tried focus, it worked. But as soon as I extended the new form from our base parent form class, the form stopped responding to .focus. Clearly it's something to do with our code and (probably) it's use of Windows virtual desktops. Nothing for you to worry about.

On a personal note, SikuliX is an amazing project! I am relying on it more and more everyday. Keep up the excellent work!

RaiMan (raimund-hocke) said : #4

Hi Ben: thanks for kind feedback. All the best.