Quasi-daily thoughts. No cute taglines.

Sunday July 10

Workflows Part 1: Desktop Web Services

Ted Leung recently wrote about the potential for workflow automation that lurks within Mac OS X:

The ability to do custom cross application workflows is something that I've found really easy to do. Between Automator, AppleScript, Python, pyobjc, and appscript, there's a wealth of tools for doing this sort of thing.

Wow is he right. For the last year, I've been learning how to harness this power to create the kind of environment that suits me. It started out with a few simple Python scripts which I gradually came to rely on. Slowly they have evolved to the point where they've stopped being just scripts and started becoming an "integrated development environment", albeit more "loosely coupled" than "integrated".

At its core, my system is built on the web services model. I have a little web server running on my desktop, written in Python, which exposes an XMLRPC interface. HTTP is so ubiquitous now that I can communicate with the server from just about any language, process, or computer that needs to be part of the workflow automation. The server also renders web pages, and so it's primary user interface is a web browser.

The glue that binds it all together is Quicksilver. I have Quicksilver keyboard triggers that call all of my most common functions. These triggers call out to Python and Applescript, which can do stuff like:

  • Look at the line of text that I'm currently editing
  • Process whatever is in the clipboard
  • Tell Firefox or Safari to run a bookmarklet
  • Create a new file and open it in my editor
  • Post the file I am editing to my weblog

The list goes on... The end result is that Quicksilver, my text editor (BBEdit), and my web browser (Firefox) are joined together to form a very unique kind of development environment.

In the upcoming segments of this "Workflows" series, I will be describing some of my favorite automations, explaining how they work, and sharing some source.

Posting your comment. Please Wait...