if ($dialog(name)) { ;it's open }