# system.nav.openWindow, wait for window to close before finishing script?

**URL:** <https://forum.inductiveautomation.com/t/system-nav-openwindow-wait-for-window-to-close-before-finishing-script/57024>\
**Category:** Ignition\
**Created:** [March 9, 2022, 5:52pm UTC](https://forum.inductiveautomation.com/t/system-nav-openwindow-wait-for-window-to-close-before-finishing-script/57024 "2022-03-09T17:52:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jacob\_Sanchez](https://forum.inductiveautomation.com/u/Jacob_Sanchez)\
**Post date:** [March 9, 2022, 5:52pm UTC](https://forum.inductiveautomation.com/t/system-nav-openwindow-wait-for-window-to-close-before-finishing-script/57024/1 "2022-03-09T17:52:27Z")

</div>

I have a button if mouseClicked, i want it to open a window where i will input some data, the close button will write the data back to the custom properties of the button that initiated the opening the window. The script then would pass this data (along with some others that were already defined in custom properties) to a project script. The issue i am having is i am unsure of how to “pause” the script without blocking everything else in the process. I’ve looked into system.util.invokeLater but i can’t seem to piece it in to what i’m trying to do.

```auto
snoozeDuration = int(0)

system.nav.openWindow("getSnoozeDuration")

while(snoozeDuration == 0):
	snoozeDuration = event.source.snoozeDuration

alarms.snoozeButton(event)

```

---

<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:** [March 9, 2022, 6:00pm UTC](https://forum.inductiveautomation.com/t/system-nav-openwindow-wait-for-window-to-close-before-finishing-script/57024/2 "2022-03-09T18:00:36Z")

</div>

> [@Jacob\_Sanchez](#):
>
> i am unsure of how to “pause” the script without blocking everything else in the process.

You cannot. Pausing a component event script freezes the whole GUI. There is no equivalent to VB's "doEvents" statement.

What you _ **can** _ do is stick a callable (function object) into a client property of the pop-up and have the popup look for it and run it on close. See this related topic:

> [@Working with python datatypes across multiple Vision windows?](https://forum.inductiveautomation.com/t/working-with-python-datatypes-across-multiple-vision-windows/56414/2):
>
> In vision, you can attach arbitrary objects to windows and components with Swing’s .putClientProperty() method. Many examples here on the forum. In the gateway and for certain cases in Vision clients, you can use system.util.getGlobals() to stash arbitrary objects. However, there are some gotchas: Actual persistence of getGlobals has varied across versions. Badly broken in the middle of v7.9 all the through early v8.1. I created a work-around for those who need it via system.util.persist…
