You can try SikuliX . It is an education-based framework that can be used with Python (through Jython), Ruby (through JRuby), and Java (through the optional Java API).
It is very convenient to automate certain behaviors on your screen, for example, open Photoshop, click areas on the screen, or enter using the key. For example:
//Using Java API, however the idea is the same for Python Screen screen = new Screen() screen.type(new Pattern("some-image.png"), "keyboard");
In Python:
def changed(event): print "something changed in ", event.region for ch in event.changes: ch.highlight() # highlight all changes sleep(1) for ch in event.changes: ch.highlight() # turn off the highlights
with selectRegion ("select region to observe") as r: # any change in r exceeding 50 pixels will cause the changed function onChange (50, changed) to observe (background = True)
wait (30) # another way to observe for 30 seconds r.stopObserver ()
This is quite a bit of work, but it allows you to create very reliable scripts that perform the necessary actions. You can also pass console output back to your Python script through subprocess to change the behavior of scripts based on the environment.
Rest is limited by your imagination.
Note: not everything should be done with SikuliX, infact I would not recommend doing everything. Just certain things that may require specific behavior on your screen.
If you are strictly on Ubuntu, you can also watch Xpresser
Update
So, I worked with AutoIt and PyAutoIt and will sincerely think that they are suitable tools for what you want to achieve, as they can be very effective for certain applications.
Juxhin
source share