Help > Authoring > Macro Recorder > Assigning Macros to Menu Items and Toolbar Buttons
  
Assigning Macros to Menu Items and Toolbar Buttons
Macros can be assigned to menu items and toolbar buttons. For example, the following code runs the macro named Highlight from a button in a XUI dialog box:
<button label="Highlight">
<script ev:event="domactivate"
ev:propagate="continue"
type="application/x-javascript">
var dialog = Application.event.view.window;
dialog.close();
Application.run("Highlight")
</script>
</button>
For details on working with toolbars and menu items, refer to the Working with XUI (XML-based User Interface dialog boxes) section of the Customizer's Guide.