"Persistent" Scripted Value

Working with DMX Input Triggers, I have a few DMX Addresses, I'm notating them as DMX(Address) below:

I have a setup where I'm using a trigger for DMX(6) Input to set Timeline Rate for a Mosaic system. I Wrote a script that searches the Timelines that could be running, finds the Timeline that is onstage, and applies the DMX(6) Value as the :set_rate(DMX)

There is also a DMX Channel that will Start Timelines in Mosaic. A Script I wrote will set the Timeline from DMX(5) mapped to a range of Timelines.

The goal is any time I change to a new Timeline Selection, I want the New Timeline that is running to also :set_rate(DMX6) from the DMX Trigger.

I'm thinking it would be best to Set a variable in the Timeline Rate, that when the trigger for DMX(5) starts a new timeline, it should also set the Rate from this variable.

But I'm not quite sure I understand how to make a Variable that can be set in one Script, and then read in another script.

Related