# Script working on one project but not on the next one

**URL:** <https://forum.inductiveautomation.com/t/script-working-on-one-project-but-not-on-the-next-one/81956>\
**Category:** Ignition\
**Tags:** ignition81, scripting, vision\
**Created:** [November 15, 2023, 9:05pm UTC](https://forum.inductiveautomation.com/t/script-working-on-one-project-but-not-on-the-next-one/81956 "2023-11-15T21:05:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![imt.sebastian.sanche](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@imt.sebastian.sanche](https://forum.inductiveautomation.com/u/imt.sebastian.sanche)\
**Post date:** [November 15, 2023, 9:05pm UTC](https://forum.inductiveautomation.com/t/script-working-on-one-project-but-not-on-the-next-one/81956/1 "2023-11-15T21:05:36Z")

</div>

Hi, I have a script on a button that will write to custom properties on my container. I was modifying something else completely and when I went to test the script stopped working.

```auto
if event.source.componentEnabled:
	event.source.parent.TabIndexSelected = 4
	event.source.parent.LocalDBRefresh = 1
	event.source.parent.LocalDBRefreshDebounce = 1

```

On a different project in the same gateway this script works perfectly but when I tried in a different script it didn't worked. I've tried removing the property and create it again but there is something that doesn't want to work. I made sure buttons were enabled. I will probably just get the view from the project that is working into the one that is not.

I just wanted to know if anyone would have some kind of answer.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [November 15, 2023, 9:15pm UTC](https://forum.inductiveautomation.com/t/script-working-on-one-project-but-not-on-the-next-one/81956/2 "2023-11-15T21:15:49Z")

</div>

By not working do you mean that it throws an error or that it simply does nothing?

---

<div class="post-metadata">

**Author:** ![imt.sebastian.sanche](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@imt.sebastian.sanche](https://forum.inductiveautomation.com/u/imt.sebastian.sanche)\
**Post date:** [November 15, 2023, 9:34pm UTC](https://forum.inductiveautomation.com/t/script-working-on-one-project-but-not-on-the-next-one/81956/3 "2023-11-15T21:34:39Z")

</div>

It simply does nothing, there is no error and the custom properties are not changing. I just confirmed that 2 out of 3 projects that have this script don't work.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [November 15, 2023, 9:40pm UTC](https://forum.inductiveautomation.com/t/script-working-on-one-project-but-not-on-the-next-one/81956/4 "2023-11-15T21:40:39Z")

</div>

This is from the actionPerformed event handler?

---

<div class="post-metadata">

**Author:** ![imt.sebastian.sanche](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@imt.sebastian.sanche](https://forum.inductiveautomation.com/u/imt.sebastian.sanche)\
**Post date:** [November 15, 2023, 9:45pm UTC](https://forum.inductiveautomation.com/t/script-working-on-one-project-but-not-on-the-next-one/81956/5 "2023-11-15T21:45:44Z")

</div>

Correrct, its on a button. The script is supposed to run when button is released.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 16, 2023, 6:11pm UTC](https://forum.inductiveautomation.com/t/script-working-on-one-project-but-not-on-the-next-one/81956/6 "2023-11-16T18:11:58Z")

</div>

Try using `.enabled` instead of `.componentEnabled`
