# Get Opened Window from Tag Event Script

**URL:** <https://forum.inductiveautomation.com/t/get-opened-window-from-tag-event-script/10447>\
**Category:** General Discussion\
**Created:** [September 10, 2015, 4:47am UTC](https://forum.inductiveautomation.com/t/get-opened-window-from-tag-event-script/10447 "2015-09-10T04:47:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://forum.inductiveautomation.com/u/ian)\
**Post date:** [September 10, 2015, 4:47am UTC](https://forum.inductiveautomation.com/t/get-opened-window-from-tag-event-script/10447/1 "2015-09-10T04:47:31Z")

</div>

Hi all,

Related to [this](https://inductiveautomation.com/forum/viewtopic.php?f=25&t=14372) post, how can we get opened window from Tag Event Script?

I have a tag event script:

```auto
w = system.gui.getWindow('MyWindow')
```

which return error

> [@](#):
>
> 'com.inductiveautomation.ignition.common.script.Scr' object has no attribute 'gui'

---

<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:** [September 10, 2015, 10:19am UTC](https://forum.inductiveautomation.com/t/get-opened-window-from-tag-event-script/10447/2 "2015-09-10T10:19:17Z")

</div>

Tag event scripts run in the gateway, not the client. The gateway doesn’t have the gui scripts because it is a service with no gui.

---

<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:** [September 10, 2015, 10:25am UTC](https://forum.inductiveautomation.com/t/get-opened-window-from-tag-event-script/10447/3 "2015-09-10T10:25:54Z")

</div>

You can use a ‘Tag Change’ script instead, under ‘Client Event Scripts’ in the designer. Yes, it’s odd that there are two different places to run events on tag changes, but where the script runs matters.

---

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://forum.inductiveautomation.com/u/ian)\
**Post date:** [September 15, 2015, 1:54am UTC](https://forum.inductiveautomation.com/t/get-opened-window-from-tag-event-script/10447/4 "2015-09-15T01:54:21Z")

</div>

Hi pturmel,

Thanks! That explains the phenomenon. Previously, I always thought that the Jython script in Ignition has the same base libraries every where it runs… Now, I got to be more careful, I guess. 😕
