Your reply did make me take another crack at it and I got it to work. The script if anyone is interested: http://pastebin.com/pC9VTzjv. It does do some specific-to-me things to close apps I usually have open that did not want to minimise.