I am trying to design an application that scripts a GUI to expose its functionality as a set of web services. Under Windows, I can start one or more instances of the GUI and then start a Ruby program which obtains a reference to one of the GUIs and scripts it using Win32API. I need a continuously running Ruby program (the Manager) that holds references to each GUI and maintains state information about which session id is assigned to the GUI instance and what screen the GUI is currently sitting on. This is to avoid starting up an instance for each call, and navigating to the relevant screen unnecessarily. What I thinking is when a web service call comes in I want the web service to connect to the Manager which will then check whether one of the GUIs is assigned to the session concerned and return a reference to the correct GUI so the web service can script it (or perhaps start up another instance if one is required). I could communicate with the Manager by some polling mechanism. But then again if I can use Win32API to connect to the GUI, I should be able somehow to connect to the Manager, although I not sure how I would pass data to and from it. How do people normally do this kind of thing?