runScript in tag expression causes error

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:

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

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

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?

Try it without the parentheses.

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

Same errors…

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

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

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.

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.

4 Likes