I took the script and added support for Keyboard Maestro variables as parameters. Perhaps it could be useful to some here.