Hmm good question. I don't think there is one?
I threw together a simple script to get it for you in the mean time:
lswintxt.exe
You can just run it as: lswintxt "MyVar" "WinTitle"
MyVar will then hold the window text to do whatever you want with. (ex: !alert "$MyVar$")
Note: It uses !SetEvar from xlabel. WinTitle is case sensitive and must be quoted if there are spaces.
edit
I updated the file to change new lines in to < b r > (no spaces) so xlabel will treat them as new lines. Btw, I've been noticing some real inconsistencies on the $var$ being properly set. Sometimes it is, sometimes it isn't. I'm not sure if this is a timing issue with !SetEvar and the speed the var is cleared and reset or what.