>if no atoms were picked, I would see the alarming error messages: >Selector-Error: Unknown keyword or selection. >Selector-Error: Malformed selection. >( ( lb<-- >Is it possible to suppress them and still get the result?
Some kind of preliminary existence check might help. Something similar to from pymol import cmd from types import * def sele_exists(sele): sess = cmd.get_session() for i in sess["names"]: if type(i) is ListType: if sele==i[0]: return 1 return 0