function onSample() { if (shell.isPopupOpen) { shell.print("There is a popup open somewhere."); } else { shell.print("No popups open."); } }