# Access a Window reference from Gateway Script

**URL:** <https://forum.inductiveautomation.com/t/access-a-window-reference-from-gateway-script/24359>\
**Category:** Ignition\
**Tags:** scripting, ignition79\
**Created:** [April 24, 2019, 2:05pm UTC](https://forum.inductiveautomation.com/t/access-a-window-reference-from-gateway-script/24359 "2019-04-24T14:05:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![c.bertulli](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.bertulli](https://forum.inductiveautomation.com/u/c.bertulli)\
**Post date:** [April 24, 2019, 2:05pm UTC](https://forum.inductiveautomation.com/t/access-a-window-reference-from-gateway-script/24359/1 "2019-04-24T14:05:54Z")

</div>

Hi All,

Is there a way to obtain a window reference from Gateway Event Scripts?  
Something like the **return** of `system.gui.getWindow()`  
What I want to achieve is to be able to use `system.db.refresh()` on a Chart Component located in a window from Gateway Event Scripts

Cheers,

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [April 24, 2019, 3:06pm UTC](https://forum.inductiveautomation.com/t/access-a-window-reference-from-gateway-script/24359/2 "2019-04-24T15:06:44Z")

</div>

To my knowledge, no known way to accomplish that from a Gateway Event Script (scoping and whatnot), but a Client Event Script could certainly work.

---

<div class="post-metadata">

**Author:** ![Stevenson.Yuan](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Stevenson.Yuan](https://forum.inductiveautomation.com/u/Stevenson.Yuan)\
**Post date:** [April 25, 2019, 4:01pm UTC](https://forum.inductiveautomation.com/t/access-a-window-reference-from-gateway-script/24359/3 "2019-04-25T16:01:35Z")

</div>

Alternatively you can use the message handlers from the gateway scope sending a message to all the clients perhaps check if a window is open then performing a refresh on the component’s data.
