# Running Library Script from Designer Script Console

**URL:** <https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [October 7, 2025, 9:13pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250 "2025-10-07T21:13:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 7, 2025, 9:13pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/1 "2025-10-07T21:13:27Z")

</div>

I have a project set as the gateway scripting project and the script executes no problem from the designer of that project.

However, I open the script console in the designer on a different project on the same gateway and it says the function is not defined.

Is this because the script is running in the designer/client scope of the 2nd project?

If so, can I test these scripts in gateway scope outside of the scripting project?

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [October 7, 2025, 9:22pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/2 "2025-10-07T21:22:05Z")

</div>

Is the script you're trying to run new, and if so, did you save it and then merge changes in the other project?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c63f4283adbc23791e04fbabbe7422284aa5826d.png)

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 7, 2025, 9:22pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/3 "2025-10-07T21:22:28Z")

</div>

It’s been saved. Changes have been merged, gateway has been restarted. The gateway scripting project is set correctly

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [October 7, 2025, 9:52pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/4 "2025-10-07T21:52:32Z")

</div>

I sometimes cheat and put a gateway tag change event in that calls the script, assign it to a temporary boolean memory tag then just toggle the tag to run it.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 7, 2025, 10:02pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/5 "2025-10-07T22:02:49Z")

</div>

So yes, the issue is that it’s running in the designer scope?

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [October 7, 2025, 10:13pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/6 "2025-10-07T22:13:42Z")

</div>

I assume so, I have not had a chance to replicate and test the idea.

---

<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:** [October 7, 2025, 10:27pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/7 "2025-10-07T22:27:40Z")

</div>

The 'Gateway Scripting Project' setting is totally orthogonal to the question of which scripts are 'visible' when you're in the script console.

digraph Tree { rankdir=TB; node [shape=box, style=rounded]; edge []; Grandparent; Parent []; Aunt []; Child1 [label="Child 1"]; Child2 [label="Child 2"]; Child3 [label="Child 3"]; Child4 [label="Child 4"]; Grandparent -\> {Parent, Aunt}; Parent -\> {Child1, Child2}; Aunt -\> {Child3, Child4}; }

If you open `child 1` in the designer, you'll be able to use the project library of `child 1`, which will **include** any project library scripts defined in `parent` and `grandparent`, because project inheritance delivers you a "flattened" representation of parent project's resources as if they existed in your own project. You will **not** be able to use `aunt`'s resources, because they are invisible to you.

The gateway scripting project could be **any** of those projects. All the gateway scripting project setting affects is which project's scripts you are able to use in gateway contexts that are **not associated with a project**. In other words - in the `runScript` function in expression tags. Lots of other ways to author expressions run on the gateway (Perspective, Reporting, Alarm Pipelines, SFCs, etc) - but all of those are **associated with a project** , and therefore naturally participate in project inheritance and pay **no attention** to the gateway scripting project.

Restated again - if the gateway scripting project is `child 3`, you're able to use scripts from `child 3`, `aunt`, and `grandparent` in your expression tags' `runScript` expressions.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 8, 2025, 7:52am UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/8 "2025-10-08T07:52:34Z")

</div>

> [@paul-griffith](#):
>
> expression tags' `runScript` expressions.

And in case anyone reads this as a definitive list, it also includes other gateway scoped places like tag value change events

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 8, 2025, 3:11pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/9 "2025-10-08T15:11:22Z")

</div>

Ultimately, I’m trying to get this script to run in a notification pipeline on the 2nd project. Does that script not execute in gateway scope? In my logs it says that the library is undefined.

---

<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:** [October 8, 2025, 5:07pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/10 "2025-10-08T17:07:29Z")

</div>

Yes, but gateway scope ≠ gateway scripting project. The GSP is just one small piece of gateway scope.

\*_Cough_\* _Share more details, like actual project names and inheritance, and the GSP name._

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 8, 2025, 9:26pm UTC](https://forum.inductiveautomation.com/t/running-library-script-from-designer-script-console/111250/11 "2025-10-08T21:26:36Z")

</div>

> [@amarks](#):
>
> I’m trying to get this script to run in a notification pipeline on the 2nd project

Alarm pipelines are defined in _project_ configuration. Whatever is attached to a project will not care what project you've set as your GSP. The same applies for example to gw script events like timers and scheduled events which are both attached to a project, despite all running in the gateway.  
Tags on the other hand are not attached to projects and therefore need to know what project to use for a script library, as script libraries are _project resources_
