# runScript in tag expression causes error

**URL:** <https://forum.inductiveautomation.com/t/runscript-in-tag-expression-causes-error/28910>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [October 8, 2019, 11:58am UTC](https://forum.inductiveautomation.com/t/runscript-in-tag-expression-causes-error/28910 "2019-10-08T11:58:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 8, 2019, 11:58am UTC](https://forum.inductiveautomation.com/t/runscript-in-tag-expression-causes-error/28910/1 "2019-10-08T11:58:55Z")

</div>

In 7.9 we used the runScript expression to call shared scripts for various activities. In 8.0 I’m attempting to do the same, but any script I put into the runScript always fails.

For instance, I have this test shared script to be able to check if things are working:

```auto
Located in ESP.Standards.TagHelpers script
def test():
	return 'Hello World'

```

I’m attempting to use it in a tag expression type like this:

```auto
runScript('ESP.Standards.TagHelpers.test()')

```

I only get errors back when looking at the diagnostics for the tag.

Specifically the Quality is:  
Error executing script for runScript() expression:ESP.Standards.TagHelpers.test()

and the Last Published Value is:  
[null, Error\_ExpressionEval(“Error executing script for runScript() expression:ESP.Standards.TagHelpers.test()”), Tue Oct 08 07:56:39 EDT 2019 (1570535799279)]

The script runs fine when I drop it into the script console. The script also runs fine when dropped into a window, it just seems to struggle with being in a tag.

Any ideas?

---

<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:** [October 8, 2019, 12:05pm UTC](https://forum.inductiveautomation.com/t/runscript-in-tag-expression-causes-error/28910/2 "2019-10-08T12:05:36Z")

</div>

Try it without the parentheses.

```auto
runScript('ESP.Standards.TagHelpers.test')

```

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 8, 2019, 12:07pm UTC](https://forum.inductiveautomation.com/t/runscript-in-tag-expression-causes-error/28910/3 "2019-10-08T12:07:35Z")

</div>

Same errors…

Error executing script for runScript() expression:ESP.Standards.TagHelpers.test

---

<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:** [October 8, 2019, 12:13pm UTC](https://forum.inductiveautomation.com/t/runscript-in-tag-expression-causes-error/28910/4 "2019-10-08T12:13:02Z")

</div>

I think it need to be in the global project. Tags don’t run things down to the project level.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 8, 2019, 12:14pm UTC](https://forum.inductiveautomation.com/t/runscript-in-tag-expression-causes-error/28910/5 "2019-10-08T12:14:26Z")

</div>

Yep... this new version is bending my mind a little bit.

OK... I found it in another forum post that my google-fu couldn't find.

> [@runScript in expression tag](http://forum.inductiveautomation.com/t/runscript-in-expression-tag/10378/17):
>
> I see that you are in Ignition 8 instead of the original posts which are in 7.9. There is no longer the “Global” project that you are familiar with in 7.9. Instead, tags have access to scripts that are in the Gateway Scripting Project. This is configured on the gateway web page Config \> Gateway Settings \> Gateway Scripting Project. At this point, the script you want to access in the tag HAS to be on that project. Tags cannot run scripts from another project that inherits that project. From your…

I have a global project for all the projects called ESPGlobal and I just changed from global to ESPGlobal. Once I did that bingo things are back and working.
