Load packages the script depends on:

- <ref>actions</ref> for registering the new action;
- <ref>dialogs</ref> for creating a dialog box.

Create a function ev_action that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called.

When the action event is called, use <ref>dialog_report</ref> to pop up a report dialog. First argument donates the name (title) of the window, the second is the text printed in the window.

Create a function ev_gui_init that will be called when the gui has been initialized - this is the right moment to register new menus in the GUI. Put the new menu item in the "Plugins/GPMI scripting/" menu by convention, and set hot key to ctrl+w. The menu should execute action hello().

In the "main" section of the script, bind event <ref>ACTE_action</ref> to our local function ev_action - this gets ev_action to be called when any of the actions registered by this script is executed. Also bind ev_gui_init so that the new menu can be safely created.

Finally use <ref>action_register</ref> to register the action:

- first argument is the name of the action
- second is the xy query string; it is empty since this action won't need coordinates to operate on
- third is the description that shows up in dumps and helps
- fourth is the syntax description (also for helps)