Thanks kkThnx, the one you posted works the same as Munk's code basically. It clears selected windows without clearing all windows.
For some reason, it clears the combat log fine, but if you tab between the combat log views (What happened to me?) thing it repopulates the data you previously cleared. If this is unavoidable then it's fine, mainly just wanted to clear chat anyway.
Yah, now we can all thank Phanx as usual! Phanx has some pretty neat ways of coding things. You could learn a couple things.
Success isn't what you've done compared to others. Success is what you've done compared to what you were made to do.