A recent post here just did something like this in SWISH. Go to bottom of SWISH page and click on triangle to run example.