I cobbled this AppleScript together from various snippets and fooling around on the web.  I hope someone else finds this useful.