Controlling the Mac OSX GUI via Python?

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Thu Jun 30 19:12:29 EDT 2016


On Friday, July 1, 2016 at 10:35:42 AM UTC+12, Chris Angelico wrote:
>
> On Fri, Jul 1, 2016 at 8:27 AM, Lawrence D’Oliveiro wrote:
>>
>> GUIs, by their nature, are not designed to be automated.
> 
> Doesn't mean they can't be!

It’s more trouble than it’s worth. Different (even minor) versions of the program will move UI elements around. Things that look and behave like buttons might have underlying code that is not quite the same as that for buttons. There will be subtle timing issues, where something doesn’t quite get enabled in time for your script to click on it. You will suffer mysterious intermittent problems, where a sequence works one time but not another time.

Again: GUIs are for manual operations to be performed by humans. For automation, you need a function-based scripting API and a command line.


More information about the Python-list mailing list