Shutdown Scripts
This script type is only available in the Client scope. This is a special script that will be called when the user tries to exit or close the client, that is, shutdown the Client. This script is run with a special event variable in its namespace. When the script terminates, if event.cancel is 1, the shutdown will be aborted, and the client will remain open. Otherwise, the normal shutdown script will be called, and the client will close.
Example
if
"SuperUser"
not
in
system.security.getRoles():
system.gui.warningBox(
"Exit not allowed for non-admin user."
)
event.cancel
=
1