You can use Script Editor (a built-in feature) to add scripts to events. Open the Script Editor for an object, an active dashboard section, or a document. Script Editor contains the object browser, description pane, events menu, and scripting pane.
To open Script Editor, perform an action:
From a section other than a dashboard section, select File, then Document Scripts
From within a dashboard section, in Design mode, select Dashboard, then Scripts
For an object, select Dashboard, then Scripts