Tag valueChanged Script Project Library Script Relative Tag Path

I've got a tag valueChanged script that uses relative paths. I need to use this same script in a couple different tag scripts, so naturally I want to move it to the project library. This tag is in a UDT and within the script, it's using relative tag paths to read/write a couple of others.

How should the relative tag paths be handled? Should I pass the tagPath variable to the proejct script and update the [.] accordingly, or can the project library script use the [.] specifier since it'll be called from that tag's valueChanged script?

The called project library script will be running with java thread locals that identify the calling context. If that context accepts relative paths in tag scripting, then your project library script will be able to do the same.

Project library scripts have no context or scope of their own--they always use the caller's scope and context.

1 Like