# Automation of controls and windows on Linux and OS X with Ruby?

**URL:** <https://www.ruby-forum.com/t/automation-of-controls-and-windows-on-linux-and-os-x-with-ruby/195568>\
**Category:** Ruby\
**Created:** [September 25, 2010, 3:11pm UTC](https://www.ruby-forum.com/t/automation-of-controls-and-windows-on-linux-and-os-x-with-ruby/195568 "2010-09-25T15:11:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juuser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@juuser](https://www.ruby-forum.com/u/juuser)\
**Post date:** [September 25, 2010, 3:11pm UTC](https://www.ruby-forum.com/t/automation-of-controls-and-windows-on-linux-and-os-x-with-ruby/195568/1 "2010-09-25T15:11:05Z")

</div>

Hello!

What would be the best way to automate controls and windows on linux  
and os x? In Windows there is a Windows API, which allows to locate  
windows by their title/handle/class name whatever, to click on  
buttons, edit fields and send keystrokes. What would be the best tools  
to do these things on linux and on os x?

Maybe there’s even some existing tools in Ruby that i’m not aware of  
to do that or to wrap any of the tools? I noticed that for linux there  
is a dogtail, but it is using Python.

Also, xautomator caught my eye, but i’m not sure how usable it will be  
for finding windows themselves and then clicking buttons and so on.

In OS X there seems to be AppleScript.

Also, these tools should be easy to install and should be free.

In short, it would be great if there would be already something  
written in Ruby to do that and if not, then i could use system calls  
to accomplish something similar.

So if you have done or are aware of something similar then please let  
me know!

Jarmo

---

<div class="post-metadata">

**Author:** ![juuser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@juuser](https://www.ruby-forum.com/u/juuser)\
**Post date:** [September 25, 2010, 4:07pm UTC](https://www.ruby-forum.com/t/automation-of-controls-and-windows-on-linux-and-os-x-with-ruby/195568/2 "2010-09-25T16:07:53Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Am 25.09.2010 15:10, schrieb Jarmo P.:

> is a dogtail, but it is using Python.  
> to accomplish something similar.
> 
> So if you have done or are aware of something similar then please let  
> me know!
> 
> Jarmo

I once wrote the gem “xdo” ( [xdo | RubyGems.org | your community gem host](http://rubygems.org/gems/xdo) ) which is a  
wrapper around the xdotool command-line tool (  
[xdotool - fake keyboard/mouse input, window management, and more - semicomplete](http://www.semicomplete.com/projects/xdotool/) ). However, I haven’t  
updated xdo for a longer time now so it may not work correctly with a  
recent xdotool version – But I’m working on it. You can get a  
development version from  
[http://github.com/Quintus/Automations/tree/xdo-dev](http://github.com/Quintus/Automations/tree/xdo-dev) if you’re interested.  
Download, decompress and type “rake gem” to make a gem from it.

Vale,  
Marvin  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.10 (GNU/Linux)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org/](http://enigmail.mozdev.org/)

iQEcBAEBAgAGBQJMngIGAAoJEGrS0YjAWTKVfNQH/RsjV6eSXdbfzgz6Ac7SfHH+  
fbnb/4+NG9rUc170USSKjD64SSwmSMX61SCa7sQGNi8ICVA1JSc3ddC+aX0nsbwl  
Gu0Ncj5ViTSBjHmaIQaNI65ZpAYGh3wu1ArLFkmH/W3gfM8JOplxr18VMA2uPvhG  
e5f2swYWE/0N2+QGRa2IavySmtUoQ7H+SFQ7uAmvW0j7c5fnfeSccHuLhTuytvYz  
8I4PNr8aFY8eA9PyvwOzbO/XOx+D0xYQ+Z4PJ87HtpJLRBIdwWiwjgdRi91zh4aB  
WCrL0LHNGscUdfe0i9fWYcerWVnS8RdDtIsRWqrzbNh9SJgSID22p5ffqRs/k3A=  
=exsA  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![juuser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@juuser](https://www.ruby-forum.com/u/juuser)\
**Post date:** [September 25, 2010, 5:31pm UTC](https://www.ruby-forum.com/t/automation-of-controls-and-windows-on-linux-and-os-x-with-ruby/195568/3 "2010-09-25T17:31:00Z")

</div>

Thanks! I’ll take a look at xdo and xdotool itself. By taking a quick  
glimpse it seems that it’s not possible to interact with fields or  
buttons on the windows themselves like you can do with AutoIt.

Jarmo
