# How to know if a particular window is open

**URL:** <https://forum.inductiveautomation.com/t/how-to-know-if-a-particular-window-is-open/10790>\
**Category:** Ignition\
**Created:** [November 13, 2015, 7:50pm UTC](https://forum.inductiveautomation.com/t/how-to-know-if-a-particular-window-is-open/10790 "2015-11-13T19:50:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim/32/3361_2.png) [@Tim](https://forum.inductiveautomation.com/u/Tim)\
**Post date:** [November 13, 2015, 7:50pm UTC](https://forum.inductiveautomation.com/t/how-to-know-if-a-particular-window-is-open/10790/1 "2015-11-13T19:50:39Z")

</div>

What can I use to condition a client event script to run only if a particular window is open?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 13, 2015, 11:29pm UTC](https://forum.inductiveautomation.com/t/how-to-know-if-a-particular-window-is-open/10790/2 "2015-11-13T23:29:57Z")

</div>

Use system.gui.getWindow() in a try … except block, like so:`try:
  w = system.gui.getWindow('windowname')
catch ValueError:
  w = None
if w:
  do something`As a happy side effect, you have a reference to the window in hand, allowing you to easily get references to properties and components you might need in the script.

---

<div class="post-metadata">

**Author:** ![Tim](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim/32/3361_2.png) [@Tim](https://forum.inductiveautomation.com/u/Tim)\
**Post date:** [November 18, 2015, 2:03pm UTC](https://forum.inductiveautomation.com/t/how-to-know-if-a-particular-window-is-open/10790/3 "2015-11-18T14:03:50Z")

</div>

Thanks. Just needed to substitute except for catch
