Get a list of all applications that SikuliX currently sees

Asked by Ben Carson

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:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
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

Revision history for this message
Ben Carson (catsandcode) said :
#2

Thanks RaiMan, that solved my question.

Revision history for this message
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!

Revision history for this message
RaiMan (raimund-hocke) said :
#4

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