Hi all! I am trying to do a script who can do two diferent things depending if something is selected or not. I am looking a command like the “object exists,” let’s say… if( something is selected ) { // do this } else { // do this instead } I think it could be something like this but is not working if ( `ls -sl True` ) {…
Thanks Tekoppar! Here is another one I got that I think is more simple and I like avoiding variables for this: if (size(`ls -sl`)) { print "yes"; } else{ print "no"; }
//checks if object is selected<br>string $selt[] = `ls`;<br>for ($node in $selt) {<br> if (size(`ls -sl $node`)) {<br> //node is seleted<br> print($node + "\n"); <br> }<br>}