SetEnv question

Is it possible to set the output of a command to SetEnv. I need to set the output of this command

xprop -id $[w.id] | grep 'WM_NAME(STRING)' | sed -e 's/.*= //'

so when i can it later as $[wm_name]. This will change depending on what window im working on. Ive tried severl this but every time all i get is xprop -id $[w.id] | grep ‘WM_NAME(STRING)’ | sed -e ‘s/.*= //’

Thanks
VoiDeR

Stick it in backquotes (``) and use piperead:

PipeRead "Echo SetEnv Foo `xprop -id $[w.id] | grep 'WM_NAME(STRING)' | sed -e 's/.*= //'`

Should work with a bit of tweaking.