Publishing Scripts to the Ribbon
You can publish a script to create a tool button in the ribbon.
To publish a script:
The tool is added to a Scripts group in the Tool ribbon.
Note: Published scripts run in
Debug mode when open in the Script editor and
Run mode otherwise. Close any published scripts that are open
in the Script editor to have them run in Run mode.