# Scripting Code To Close all Open Windows

**URL:** <https://forum.inductiveautomation.com/t/scripting-code-to-close-all-open-windows/3086>\
**Category:** Ignition\
**Created:** [July 12, 2011, 12:41pm UTC](https://forum.inductiveautomation.com/t/scripting-code-to-close-all-open-windows/3086 "2011-07-12T12:41:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlr573](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jlr573](https://forum.inductiveautomation.com/u/jlr573)\
**Post date:** [July 12, 2011, 12:41pm UTC](https://forum.inductiveautomation.com/t/scripting-code-to-close-all-open-windows/3086/1 "2011-07-12T12:41:51Z")

</div>

I’m wanting to know where I can get additional information about the scripting language used in Ignition. What I’m trying to do at the moment is; once a button is pressed on the screen to close all open windows, but I would also like an external reference so i can learn the commands of the scripting language used.

---

<div class="post-metadata">

**Author:** ![f\_jons](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@f\_jons](https://forum.inductiveautomation.com/u/f_jons)\
**Post date:** [July 12, 2011, 1:29pm UTC](https://forum.inductiveautomation.com/t/scripting-code-to-close-all-open-windows/3086/2 "2011-07-12T13:29:51Z")

</div>

To close all open windows via a button press, place the following code in the actionPerformed event for said button:

```auto
for window in system.gui.getOpenedWindows():
    system.nav.closeWindow(window.getPath())
```

Note: If you don’t want to close the window the button is on, you will have to exclude it with some additional code in the for loop.

The Ignition user manual defines all of the built in scripting functions as well as has links to external references for Python and Java.  
[http://www.inductiveautomation.com/support/usermanuals/ignition/](http://www.inductiveautomation.com/support/usermanuals/ignition/)

---

<div class="post-metadata">

**Author:** ![jlr573](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jlr573](https://forum.inductiveautomation.com/u/jlr573)\
**Post date:** [July 12, 2011, 1:48pm UTC](https://forum.inductiveautomation.com/t/scripting-code-to-close-all-open-windows/3086/3 "2011-07-12T13:48:19Z")

</div>

Thank you f\_jons this is going to work very nice. I Looked through the manual I didn’t realize they put all of that information in there, very good users manual.
