Perspective: Script scopes

How do I access scripts (let’s say a CommonUtils script) from within another project library script? In other scopes, such as events, using the name of the script and the function name (ie: CommonUtils.getFormattedPercent()) works just fine. It is only when I try and access a different script function from another project library script that I get this error, “NameError: global name ‘LoggerUtils’ is not defined at org.python.core.Py.NameError(Py.java:290)”

Unfortunately, the documentation for 8.0 is still referencing 7.9 project layouts (as of this writing), and there is no guidance in the Perspective specific help, that I could find:

https://docs.inductiveautomation.com/display/DOC80/Project+and+Shared+Scripts

I can provide code examples if needed.

Thank you.

If you’re not on 8.0.1RC or a nightly, this probably won’t work consistently, which could be whole root of the problem(s) you’re running into.

But, basically - instead of having to use project.<name> or shared.<name> you now just use whatever the package name is directly; your legacy stuff will upgrade and get placed into new packages called project and shared but that’s purely for upgrade - it’s not a strict requirement.

2 Likes

This is a new project, so they are new script files. I suppose I will be upgrading then, which is probably better so that I get the fixed stuff :slight_smile:

Thank you,

-Matt

Just following up here. The upgrade to 8.0.1RC did the trick, yay!

-Matt

2 Likes