I’m trying to run a script when a client project is updated. I’ve seen older posts referencing ways of doing this but it’s not working in 8.0.
The tag used in that example is no longer available, and has been replaced as indicated here. But when I try to run a client event script on that tag change it doesn’t work.
Basically, I’m looking to close all the popups if the project is updated.
You could piggy-back on the script module reload that happens on project update. Assuming you delegate from client events to project scripts (and you should), you can expect the top level of the project script to execute again if the project has updated between events. Use a dummy timer event if you’ve nothing else. The script would look like this:
# look for popups to close....
In a timer event, call the dummy() function every couple seconds.
Ingenious trick… Is there also a way to close windows before a screen is loaded?
On one of our projects has very big screens (lots of tags on the screen), and thus it takes relatively long to load. This meant we couldn’t close the window every time, and we just open windows in front of others.
But when updating, all those windows are open together, and they all need to reopen. which makes updates very slow.
What we do now, is detect the yellow/orange update bar, and when an update is pending, close all background screens. But if people work on clients where an update is pending, they complain the screens are slow.
It would be better if we could detect when the update is executed, and run a script to close the background windows before they are opened.
Nothing comes to mind, no.
You could remove the yellow/orange update bar and replace it with your own update notification. Then when users tap on your notification to accept the update, close windows before using system.util.retarget to accept the update.
I may be doing something wrong but when I include the call to closeMyPopups in the top level of the project script the client locks up. At first it did nothing, then I added () to the function call so the last line looked like this:
Thanks for the help, I ended up finding another way to deal with this issue.
The parentheses were deliberately left off. Including them makes that routine run right then, not later. There must have been some infinite loop or other long-running operation in closeMyPopups.