# Delaying a script with popup displayed after in Perspective

**URL:** <https://forum.inductiveautomation.com/t/delaying-a-script-with-popup-displayed-after-in-perspective/48661>\
**Category:** Ignition\
**Tags:** ignition80, perspective, scripting\
**Created:** [July 9, 2021, 2:08pm UTC](https://forum.inductiveautomation.com/t/delaying-a-script-with-popup-displayed-after-in-perspective/48661 "2021-07-09T14:08:53Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 9, 2021, 2:28pm UTC](https://forum.inductiveautomation.com/t/delaying-a-script-with-popup-displayed-after-in-perspective/48661/3 "2021-07-09T14:28:02Z")

</div>

When I’ve had to do something similar, I use [invokeAsynchronous](https://docs.inductiveautomation.com/display/DOC81/system.util.invokeAsynchronous) like this:

```auto
# not tested in live environment - only provided as quick example of structure
def openPopupLater(sessionId, pageId):
    from time import sleep
    sleep(4)
    system.perspective.openPopup(id="DeviceReady", view="ViewToUse", sessionId=sessionId, pageId=pageId)

sessionId = self.session.props.id
pageId = self.page.pageId
# logic for resetting device goes somewhere before this line
system.util.invokeAsynchronous(openPopupLater, [sessionId, pageId])

```

It’s been explained to me that `invokeAsynchronous` is executed in its own thread, so you don’t risk blocking the current thread. As long as you’re not invoking this in a manner were you are sleeping on all available threads you should be fine.

---

_[View the full topic](https://forum.inductiveautomation.com/t/delaying-a-script-with-popup-displayed-after-in-perspective/48661)._
