MoneyWorks Manual
Edit
Unload
Automatically called: When the script is about to be unloaded. Script unloading happens when you deactivate the script in the script editor (including the implicit deactivate that happens when you change and reactivate the script), or—more usually—when you log out of the document.
Use for: Use this kiss-off as an opportunity to e.g. save persistent values in the database (although note that in MoneyWorks 8, simple properties can be persistent on clients using a persistent property
declaration.
Return value: ignored
Example :
on Unload Say("Goodbye!") end