2

lately I have been trying to find a way to control applications on my ubuntu using python. What i want to achieve is something like what we can do with applescript in mac.... Control chrome send queries to it etc.

can someone please point me in the right direction as to how one can control applications using python, esp on Ubuntu...or a code snippet maybe?

2 Answers 2

2

Read about D-Bus: http://en.wikipedia.org/wiki/D-Bus

Python dbus: http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html

In order to control a process, it must be connected using dbus in the first place and exporting services. This is the same idea of AppleScript. On a mac, an application has to be exporting services that can be controlled over applescript.

PyQt/PySide has a DBus module as well: http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qtdbus.html

Sign up to request clarification or add additional context in comments.

1 Comment

I'd just emphasize that while there are many mechanisms by which an application can expose it's functionality for external scripts and applications to access it, the application must be written to actually do that. Even on the Mac, many mac apps don't expose meaningful functionality for access via Applescript. You'll need to research the apps and see what, if any, APIs and automation mechanisms they expose. e.g. for Chrome, which you specifically mention, Selenium might be a good solution and is cross platform.
0

Have you taken a look at Project Sikuli?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.