Execute script on perspective page reload

When changes are made in gateway script lib or on a manual page refresh in the web browser,
Perspective current page is reloaded.

Is thera a way to detect those events ?
The aim is to run a script to setup the initial state of the current page

Yes, script modules are re-run at the top level upon their first reference after scripting restart. Log a timestamp to a top-level variable, or broadcast a message to your sessions.

I was looking for something like the vision tag [System]Client/System/LastProjectUpdate with a tag changed script on it to detect update.
In perspective I don't see how to detect from Ignition Script engine and events those events:

  • perspective client page reload due to script reload or browser page resfresh

You suggest to monitor the change of a script global variable could detect script reload and send a message to running sessions ?

I think he's saying that referencing something from the top level will trigger the script load.
I'm guessing the use of a timestamp is to avoid caching and ensuring that the top level is indeed accessed and reloaded.

But you'd better wait for his answer, I'm pretty much throwing rocks in the dark at this point.

Gateway Startup Events run at every scripting restart (project edit, or inherited project edit). That event is probably the best to use to broadcast to the project's sessions (whose message handlers will also run in the post-restart environment).

Ah ok, I see...seems to be doable