Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

A way to select a button in a window

If you have a question or need help, this is the place to be.
Post Reply
bew78
Posts: 3
Joined: Tue May 13, 2014 8:05 pm

A way to select a button in a window

Post by bew78 »

Hi all,
First of all, thanks for all, the app is so great !! ;)

I'm looking for a way to select a button on a window, like in pywinauto :
Image
In the animated gif, wait for the command "app.AboutNotepad.OK.Click()"

I want to do that in EventGhost, is that possible ?

Also, is it possible to force an app not to close, explain :
I want when my computer shutdown to click on a button on a window which is open at this time...

Or : can we delay the extinction of computer with a

Code: Select all

eg.plugins.EventGhost.Wait(3.0)
without Windows (the OS) closes any windows (the apps) ?

Thanks in advance !
Bew
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: A way to select a button in a window

Post by krambriw »

Yes, it is simple. I did like this:

1) Downloaded pywinauto http://code.google.com/p/pywinauto/down ... -0.4.2.zip and opened it
2) Copied the pywinauto folder including subs to 'EventGhost/lib26/site-packages' folder
3) Restarted EG
4) Created a python script similar to the example in the animated gif and it worked fine right away controlling Notepad

It's a good finding and could be very useful for automation of applications where public api's are not available but you still like to control them

Your second question I have not spend any time on, maybe can be solved using pywinauto

Best regards, Walter
bew78
Posts: 3
Joined: Tue May 13, 2014 8:05 pm

Re: A way to select a button in a window

Post by bew78 »

Hi thanks for your response, I tried in the python shell but I get this :

Code: Select all

>>> from pywinauto import application
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: No module named pywinauto
>>>
I've put the pywinauto :
Image
folder in :

Code: Select all

C:\Program Files (x86)\EventGhost\lib26\site-packages\
folder and i got this error...
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: A way to select a button in a window

Post by jonib »

You need to only put "pywinauto" in site-packages and not the whole "pywinauto-0.4.2". I tried and it works. Seems to be a cool library, I need to play with it later.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
bew78
Posts: 3
Joined: Tue May 13, 2014 8:05 pm

Re: A way to select a button in a window

Post by bew78 »

oh yesss, it works, thanks :)
Post Reply