# Tag change script is triggered when project is saved

**URL:** <https://forum.inductiveautomation.com/t/tag-change-script-is-triggered-when-project-is-saved/7590>\
**Category:** Ignition\
**Created:** [November 20, 2013, 4:55am UTC](https://forum.inductiveautomation.com/t/tag-change-script-is-triggered-when-project-is-saved/7590 "2013-11-20T04:55:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hari2012](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hari2012](https://forum.inductiveautomation.com/u/hari2012)\
**Post date:** [November 20, 2013, 4:55am UTC](https://forum.inductiveautomation.com/t/tag-change-script-is-triggered-when-project-is-saved/7590/1 "2013-11-20T04:55:24Z")

</div>

In my project, I have configured a tag change script to run on ‘new value’; However, I noticed that this script gets triggered every time I save the project and publish the project. Is there any way to ensure that the tag change script only when the tag value changes

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [November 21, 2013, 10:48pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-is-triggered-when-project-is-saved/7590/2 "2013-11-21T22:48:47Z")

</div>

You should be able to get around this by adding the following line to the top of your tag change scripts:

```python
if not initialChange:
    #rest of your code
```

The initialChange property is special to tag change scripts and tells you whether or not the tag change was caused by initially subscribing to the tag or not.

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [November 21, 2013, 11:02pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-is-triggered-when-project-is-saved/7590/3 "2013-11-21T23:02:50Z")

</div>

Anytime you modify the Gateway scripts, they affect the Ignition system immediately (there is no STAGING for Gateway script changes). Ignition will restart all Gateway scripts to make sure the most up-to-date scripts are running. You can see this in the web portal console.

---

<div class="post-metadata">

**Author:** ![Mahesh\_Madapathi](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@Mahesh\_Madapathi](https://forum.inductiveautomation.com/u/Mahesh_Madapathi)\
**Post date:** [September 6, 2018, 8:08pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-is-triggered-when-project-is-saved/7590/4 "2018-09-06T20:08:06Z")

</div>

Worked for me! thanks Dave. That's what exactly I was looking for.
