//create swinging Expression
string $nodes[]=`ls -sl`;
for($node in $nodes){
print ($node);
// Add rand attr
if (!`attributeExists "rand" $node`) {
addAttr -longName rand -defaultValue (rand(-1,1)) $node;
}
expression -s ($node+".rotateZ= " + $node + ".rand * sin((2+" + $node + ".rand) * time + " + $node + ".rand);") -o $node -ae 1 -uc all ;
}