# Script that has view scope

**URL:** <https://forum.inductiveautomation.com/t/script-that-has-view-scope/83912>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 8, 2024, 12:58pm UTC](https://forum.inductiveautomation.com/t/script-that-has-view-scope/83912 "2024-01-08T12:58:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pat\_Cunningham](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pat_cunningham/32/57710_2.png) [@Pat\_Cunningham](https://forum.inductiveautomation.com/u/Pat_Cunningham)\
**Post date:** [January 8, 2024, 12:58pm UTC](https://forum.inductiveautomation.com/t/script-that-has-view-scope/83912/1 "2024-01-08T12:58:55Z")

</div>

Can I create a script on a view that all components on the view can access that also has can use self? An example would be if I needed to clear text fields on a view but I did it in several different scenarios. Is there a way I could set up one script to call?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 8, 2024, 1:04pm UTC](https://forum.inductiveautomation.com/t/script-that-has-view-scope/83912/2 "2024-01-08T13:04:02Z")

</div>

Create it in Scripting → Project Library → Project Library. That will be accessible from anywhere in the project.

> [@Pat\_Cunningham](#):
>
> ... that also has can use self?

In English, please?

---

<div class="post-metadata">

**Author:** ![Pat\_Cunningham](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pat_cunningham/32/57710_2.png) [@Pat\_Cunningham](https://forum.inductiveautomation.com/u/Pat_Cunningham)\
**Post date:** [January 8, 2024, 1:08pm UTC](https://forum.inductiveautomation.com/t/script-that-has-view-scope/83912/3 "2024-01-08T13:08:16Z")

</div>

I am not sure you were cut out for customer support

---

<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:** [January 8, 2024, 1:32pm UTC](https://forum.inductiveautomation.com/t/script-that-has-view-scope/83912/4 "2024-01-08T13:32:15Z")

</div>

Pass `self` as a function argument to your project library script.

---

<div class="post-metadata">

**Author:** ![Pat\_Cunningham](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pat_cunningham/32/57710_2.png) [@Pat\_Cunningham](https://forum.inductiveautomation.com/u/Pat_Cunningham)\
**Post date:** [January 8, 2024, 3:21pm UTC](https://forum.inductiveautomation.com/t/script-that-has-view-scope/83912/5 "2024-01-08T15:21:46Z")

</div>

Thank you. Not sure why I didn't think about that.
