# Tag change gateway script problem

**URL:** <https://forum.inductiveautomation.com/t/tag-change-gateway-script-problem/5141>\
**Category:** Ignition\
**Created:** [September 13, 2012, 2:11pm UTC](https://forum.inductiveautomation.com/t/tag-change-gateway-script-problem/5141 "2012-09-13T14:11:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krozzz](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@Krozzz](https://forum.inductiveautomation.com/u/Krozzz)\
**Post date:** [September 13, 2012, 2:11pm UTC](https://forum.inductiveautomation.com/t/tag-change-gateway-script-problem/5141/1 "2012-09-13T14:11:54Z")

</div>

Hello.  
I’ve discovered such problem:  
I wrote simple script in gateway tag change scripts:

```auto
import system

system.tag.writeToTag("new", newValue.value)
print(newValue.value)
system.nav.openWindow('engineering/electro/DISEL/Activated')
```

And after tag changed I only have new value written to tag “new”, whereas next lines of script didn’t work.

How could I solve this problem?

P.S. Ignition version - 7.3.7  
There are no error or other messages in console.

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [September 13, 2012, 3:23pm UTC](https://forum.inductiveautomation.com/t/tag-change-gateway-script-problem/5141/2 "2012-09-13T15:23:17Z")

</div>

A little more information about what your trying to do would be helpful.

From your example, it looks like your trying to write a value to a tag, then display that value on a popup window. Is this correct? If not, please tell us exactly what your trying to do.

---

<div class="post-metadata">

**Author:** ![Krozzz](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@Krozzz](https://forum.inductiveautomation.com/u/Krozzz)\
**Post date:** [September 13, 2012, 6:28pm UTC](https://forum.inductiveautomation.com/t/tag-change-gateway-script-problem/5141/3 "2012-09-13T18:28:38Z")

</div>

Not exactly.  
1st I want to write value to tag.  
2nd I want to print that value to console.  
3rd I want just to open window without sending any parameters to it.  
It’s just an empty window with only one label in it.

P.S. I tried to write

```auto
print newValue.value 
```

instead of

```auto
print (newValue.value) 
```

but it still doesn’t work.

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [September 13, 2012, 6:56pm UTC](https://forum.inductiveautomation.com/t/tag-change-gateway-script-problem/5141/4 "2012-09-13T18:56:18Z")

</div>

You have to use a client script if you’re going to make project-specific modifications or calls, since the scope of the gateway contains all projects. Making a call such as opening a window can’t be done because the gateway script doesn’t know which project the script is referring to. This is something the developers have been looking into, which is to add a way to reference a specific project in a gateway script.

The print function didn’t appear in the console for a similar reason, and you should see those print results in your wrapper log.

---

<div class="post-metadata">

**Author:** ![Krozzz](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@Krozzz](https://forum.inductiveautomation.com/u/Krozzz)\
**Post date:** [September 14, 2012, 8:40am UTC](https://forum.inductiveautomation.com/t/tag-change-gateway-script-problem/5141/5 "2012-09-14T08:40:53Z")

</div>

Thanks a lot!  
Moving script to client scripts helped.
