How should I call a shared script from a Gateway Timer Event in 8.0? I’ve created a project named “Shared”, added a project library named “paintLine” to it, and set it as the “Gateway Scripting Project” in the gateway configuration.
In another project I have a Gateway Timer Event and I’ve tried using:
shared.paintLine.SomeMethod()
Shared.paintLine.SomeMethod()
paintLine.SomeMethod()
These fail with:
“No module named shared”
“NameError: name ‘Shared’ is not defined”
“NameError: name ‘paintLine’ is not defined”
That setting is for scripts executing on the gateway that aren’t tied to a project - like in tags.
Gateway Event Scripts belong to a project and so your script package should be defined there (or in any project that the current project inherits from).
Gateway Event Scripts aren’t how you encapsulate code you want to share between projects - use packages and scripts defined in the Project Library of a project that others will inherit.