global proc zbw_randomSelection() { if (`window -exists zbw_randSelUI`){ deleteUI zbw_randSelUI; windowPref -remove zbw_randSelUI; } string $RSwindow = `window -title "zbw_randomSelection" zbw_randSelUI`; columnLayout; frameLayout -w 400 -label "Random Selection"; columnLayout; text "Percentage of the selection to remove:"; intFieldGrp -label "Remove" -extraLabel "%" removeIFG; text ""; button -label "deselect random" -command zbw_randSel; setParent; setParent; setParent; showWindow $RSwindow; } global proc zbw_randSel() { string $sel[] = `ls -sl`; int $sizeSel = size ($sel); int $thisTest[] = `intFieldGrp -q -v removeIFG`; for ($a=0;$a<$sizeSel;$a++) { float $float = `rand 0 101`; int $int = int ($float); if ($thisTest[0]>$int) { select -tgl $sel[$a]; } } } zbw_randomSelection;