Well, I finally got tired of that and started researching how to get a list of window captions / titles in KDE / Qt / X11. The sad fact is I couldn't find anything that let me do it. I tried under several dozen search words and still just a lot of flak (I even came across one mail list response asking the author "Why would you want that?" .... shows how much he knew). Somehow I stumbled upon wmctrl that did exactly what I was looking for. After getting it installed I was finally able to expand the script to work with Pandora as well.
It feels nice to finally have that over with after three plus hours of frustration not finding what I was looking for.