Instantly start Sikuli scripts from anywhere using XML-RPC

Created by Tsung-Hsiang Chang
Keywords:
Last updated by:
RaiMan

*** This FAQ is currently under investigation towards the new features in Sikuli X.

*** There is a pure Java Solution (by Enix Shen https://launchpad.net/~enix12enix), that allows to trigger the run of Sikuli scripts (.sikuli) on remote machines using HTTP requests.
available at: https://github.com/enix12enix/sikuliserver

*** the following is based on an XML-RPC server set up with Sikuli script

---------- not up to date -----------

if interested, check the Jython docs about using XML-RPC.

------------------------------------------

You should read on, if you
- have a bunch of scripts you are using on a regular base
- don't want to wait 3-5 seconds for a .skl to start up
- want to integrate Sikuli scripts into other automation tools and environments
- want to have a one-click feature in your browser to fire scripts, that just know where you are

I have documented a solution based on XML-RPC, that just works with the standard features available in Sikuli 10.2.

--- Trigger the run of Sikuli scripts using XML-RPC

With this approach you may setup a XML-RPC Server running as a Sikuli script, that is able to accept xmlHttpRequests in POST format and dispatch the processing of the request to other Sikuli scripts running in the same context. So you don't need any executable (.skl) - just use your existing .sikuli's and save the startup time of about 3-5 seconds happening with every start of a .skl.

You will be able, to trigger your scripts from every environment, that is able to send an xmlHttpRequest to the server, even over the network. Communication using a text parameter forth and back at least is always available.

You can trigger your scripts
 • from Browser's using JavaScript (a customizable Safari extension (Mac and Windows) as toolbar button is available)
 • from Python, Perl, Ruby, PHP and other programming languages, who have a library to setup an XML-RPC client
 • Mac: based on Applescript you can easily integrate your Sikuli scripts into Automator workflows
 • using suitable tools that allow you to implement the instant run of Sikuli scripts using keyboard shortcuts and/or mouse actions

The used implementation is restricted to process one request after another (internally new requests are queued, if another request is still processed). But this is normally acceptable, since the average Sikuli script needs to have the full control over screen, mouse and keyboard.

But if you want, you are not limited, since it is easily possible to run your scripts parallel in different threads (funny idea to have two or more Sikuli scripts fighting against each other to get the resources under control).

Running script environments are available (see links in the README)