How to Get the PID or name of focused App?

Asked by Gabriel Nogueira on 2018-02-07

Hi everyone.

I'm learning sikuli now and need some help.

I'm using sikulixapi for Java.

I Need to get the App that is in focus and listen when the user change the focus to another app.

I'm trying this way:


This way, i get the Region of app in focus, and when the user changes, i get the new Region.

But there is a way to get the App instance by a Region?

In my project, i have to learn some data from app in screen by OCR, process and save this data by App instance. I will show the result to the user on screen when he focus the App again.

User can manage many instances of the App, with the same visual. (Like many Untitled Notepads). I have to do something to identify wich instance is in focus (like PID) and show the correct information processed before.

Some idea?


Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

Sorry, not a feature of SikuliX currently.

... but look:

Can you help with this problem?

Provide an answer of your own, or ask Gabriel Nogueira for more information if necessary.

To post a message you must log in.