Melin Expression

Hi everybody.
I'm going use value of varibale from MEL in expression but don't know how to do it.

For example : I have selected pCube1 and execute this MEL code string $sel[] = ls -sl;

Now I wont use this variable in expression . somethng like this ($sel+".scaleX") = rand(-1,1);
But it not work because ($sel+".scaleX") is MEL. How can I do this in expression?

You must use setAttr in other words mel. direct attribute connections must be declared ahead of time because they are connections. You cant just go and create them on the fly, that would berak the idea of using expressions in first place.

So if you must do this isn a expression you must then also use MEL to wirte it out. WITH ALL CAVEATS associated with this. And they are many.

Dont do expressions like this! they will only result in problems big time. It kindof works but it also undermines the maya runtie enviroment

QUOTE
How can I do this in expression?

setAttr ($sel+".scaleX") $value;

Thanks ! I'll try