# Client Event Script call on visionWindowOpened

**URL:** <https://forum.inductiveautomation.com/t/client-event-script-call-on-visionwindowopened/90108>\
**Category:** Ignition\
**Created:** [May 8, 2024, 3:29pm UTC](https://forum.inductiveautomation.com/t/client-event-script-call-on-visionwindowopened/90108 "2024-05-08T15:29:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TechEnlive](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@TechEnlive](https://forum.inductiveautomation.com/u/TechEnlive)\
**Post date:** [May 8, 2024, 3:29pm UTC](https://forum.inductiveautomation.com/t/client-event-script-call-on-visionwindowopened/90108/1 "2024-05-08T15:29:49Z")

</div>

Hi, I have created a Client Event Script on tag change. I want to call same script on visionWindowOpened.  
Right now i have to change both script if make any change in one code.  
Please help me with syntex if possible.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 8, 2024, 3:34pm UTC](https://forum.inductiveautomation.com/t/client-event-script-call-on-visionwindowopened/90108/2 "2024-05-08T15:34:26Z")

</div>

Use your project library, that's what it's there for?

Write a project library script that takes in "pure" inputs (ideally, simple primitive classes like numbers, strings, datasets, etc) and does whatever business logic. Adapt both call sites to extract those parameters from their environment and call the project library script.

---

<div class="post-metadata">

**Author:** ![TechEnlive](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@TechEnlive](https://forum.inductiveautomation.com/u/TechEnlive)\
**Post date:** [May 8, 2024, 3:57pm UTC](https://forum.inductiveautomation.com/t/client-event-script-call-on-visionwindowopened/90108/3 "2024-05-08T15:57:22Z")

</div>

Frist Thanks PGriffith, You means we directly we can not call any script.  
Only through project library...

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 8, 2024, 4:31pm UTC](https://forum.inductiveautomation.com/t/client-event-script-call-on-visionwindowopened/90108/4 "2024-05-08T16:31:06Z")

</div>

Basically, no. Through sufficient effort almost anything is _possible_ in Vision, because we don't prevent you from doing it, but it is a **terrible** idea when a much, much better one (the project library) is right there.
