rentzsch.com: tales from the red shed

Automator "Run Web Service" Parameters

Mac OS X
Automator ships with a "Run Web Service" action, which allows your workflow document to bang off an SOAP web service. Incredibly handy, allowing workflow automation that Plays Well With Others.

Seems to work a treat, unless you want to specify your parameters at runtime. Then there's no obvious way to get the previous action's result into the parameters. I was about to pen a Suck on the topic, but I decided to see if I couldn't find a work-around first.

Sure enough, we can take advantage of undocumented behavior of the "Parameters" field. It turns out this field is not just a dumb plist parser -- it's a full-blown AppleScript environment, called via the `run script` standard AppleScript addition. Arbitrary math, UI interaction, file system IO, etc., are all possible.

But our needs are simple -- we just want to populate the Parameters field dynamically. This snippet does the job:

tell app "Automator" to get execution result of workflow 1

You can download a simple sample workflow document illustrating this work-around and/or view a screenshot.

By the way, does anybody else envision pushing Automator into service as an acceptance test platform for end users?

Monday, May 02, 2005
12:00 AM