I tried to remove selected word on listbox 1
elseif ($did == 5) { did -d $dname 1 $did($dname,2).sel }
Should be:elseif ($did == 5) { did -d $dname 1 $did($dname,1).sel }
Edit: This topic, to me, was very unclear... My bad, Riamus2 got the problem that you're having with the code.