if is then .....

ok . i need to write a simple expression but I am Stuck.
the goal is :
when object A is selected select object B.
well I was thinking that I can do it with an if statment
aka:
$s = ls -sl;
if ( $s == A)
select -tgl B:

well thats the Idea . of course it does not work . so Could you help me to write the expression that will .
thanks
yury

If you need a script that continually monitors the selection state of an object you need to look into the scriptJob command.

--JeffD

thanks Man .
actually I ended up using the For Function to get what I want:

$q = ls -sl ;
// print $q;
for ( $x in $q ) {
if ( $x == "ball" )
select -add ball1;
}

anyway thnks for the input.
yury