The OnInit event is called once for each script add-in to initialize it. The event will be called on program startup, and also if a script is added or edited while Opus is already running. Implementing the OnInit event is optional, but highly recommended as it allows you to provide a name, description and other information to be shown to the user in Preferences. It also provides a way for a script to add internal commands and columns (although the OnAddCommands and OnAddColumns methods provide a better way to do this).

Method Name: OnInit

Argument Type:


Return Type:



When Opus starts up, or when a script add-in is added or edited, its OnInit method is called. This gives the script a chance to tell Opus something about itself, by setting the various properties of the ScriptInitData object. The AddCommand method can also be used from this event to add internal commands to the Opus command set, and AddColumn method can be used to add columns.
If you return True from this method, the script will be disabled until the next time OnInit is called (which normally would be the next time Opus is run). For instance, you might want to do this if the version of Windows isn't appropriate for your script.