Edit

Load

The MWScript main entry point.

Automatically called:  When your script is loaded. Scripts in the document are usually loaded when you open or connect to a MoneyWorks document.

Use for:  To do any necessary initialisation you need (such as installing a menu command in the Command menu), or, if your script is to be manually invoked from the Script Editor, this is the main entry point for your script.

Return value:  ignored

Example :

on Load
    Alert("Hello World!")
end

Note: You should not normally do anything that invokes a modal user interface (like Alert), or making database requests in a Load handler for a script that will load every time you log into the document. The exception would be if you are just testing something out (as in the example above). In this case, you should use Run Once to Load and Unload the script so that it will not be saved as active and run for everyone when they log in.