List the current process/application the system running

Asked by Tony Liang

Hi

Is it possible in sikuli to list all the application names opened in the system? I am using windows 7. My purpose is to identify the open applications with a particular title pattern, focus each of them one by one and do some operations in there.

Thank you.

Regards
Tony

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Sorry, currently not, but it is a feature request, that makes sense ;-)

Revision history for this message
obiwan-92 (obiwan-92) said :
#2

Hello,

Well if you want find only one window, you can use :
app = App("youTitlePatern")
app.focus() # switch on the open window if it's not minimize

In python, you can also download dragonfly :
from dragonfly import Window
Window.get_all_windows()

In java, you can get the Java window like this :
Window.getWindows(); // return only the Java window

After, you can make a request in batch or shell to obtain all the running process in your system.

Hope it's help
Regards.

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

@ obiwan-92
dragonfly cannot be used with Sikuli directly (via import), because it internally is based on C-Types (access to win32 API).
In Sikuli only Python modules can be used, that are completely written in Python language or are ported to the Java based Jython environment.

Revision history for this message
obiwan-92 (obiwan-92) said :
#4

Ah yes.

But because you are on Windows 7, you can obtain the list with popen command.

import subprocess as sub
p = sub.Popen("TASKLIST",stdout=sub.PIPE,stderr=sub.PIPE)
output, errors = p.communicate()
print output

After, you just have to work on the output str.

Try and say me if that's work.

Regards.

Can you help with this problem?

Provide an answer of your own, or ask Tony Liang for more information if necessary.

To post a message you must log in.