Musings of a Fondue

Automation With Sikuli

I had used BB Flashback to record a scene I was interested in animating. However, the program doesn’t come with a way to export several images at once. You have to export each one individually.

I had done this before for about 200 images and it was a never again experience! Through the magic of Google and StackOverflow, I came across Sikuli.

What a sick program!!! (pun unintended.) It basically allows you to control any GUI (Graphical User Interface) via scripts! And it is ridiculously intuitive.

I quickly downloaded it, and set about making it do the tedious chore of saving each individual frame.

The process to manually export frames in BB Flashback is as follows,

  1. Go to the File menu, and select ‘Save Frame as Bitmap’
    • alternatively use they keyboard shortcut of CTRL+B
  2. In the save dialogue that appears, enter a file name and then click OK.
  3. Rinse and repeat for all frames

Here is the code I wrote to accomplish this in Sikuli,

The code initializes a variable called counter (though it could be called whatever you want) and sets its value to zero.

While the value of counter is less than 15 (the number of frames we are interested in), Sikuli should,

  1. press CTRL+B (to open the save dialogue)
  2. type the value of counter (this will be the file name)
  3. click OK
  4. press RIGHT (to advance to the next frame)
  5. increment the counter by one

And voila! Here is a video of it in action,

So if you’re feeling like a lazy bum, check it out. The website highlights clever uses such as automatically logging you out when a certain somebody comes online. But your imagination is the real limit here!

Side note

Sikuli would be a very cool way to demonstrate and teach some basic programming to first timers since it’s so visual and the rewards are immediate!