Custom Script Buttons

User scripts can be added to the Automation | User Scripts section of the Ribbon. A command button is created for the script. Click the button to run the script in the current Grapher window. Scripts that are used often can be placed in the ribbon for easy access. However, scripts that are not used repeatedly should still be run with the Automation | Scripts | Run command. A maximum of 21 scripts can be added to the ribbon.

The Save and Export, Create scatter plot matrix, and Print All Open Documents sample scripts are included in the Developer | User Scripts section of the ribbon by default.

Adding Scripts to the Ribbon

The Automation | User Scripts | Add Scripts command adds a script to the Automation | User Scripts section of the ribbon. The process to add a user script to the ribbon is as follows:

  1. Click the Automation | User Scripts | Add Scripts button. The Open dialog is displayed.
  2. Navigate to and select the desired script (*.BAS) file.
  3. Click Open in the Open dialog.
  4. The script is added to the Automation | User Scripts section. The command name is the script file name.

Running Scripts from the Ribbon

Click the button for the desired script and the script will run in the current Grapher window. If an issue occurs while the script is running, an audible Windows chime will play, and the script will appear in the Script Manager for editing.

Editing and Removing Script Buttons

To remove a script from the Automation | User Scripts section, right-click on the button and select Remove from the context menu.

It is possible to change the name of the button after the script has been added with the Add Scripts button. To change the button name, manually edit the UserTools.ini file located in the AppData directory (C:\Users\<user name>\AppData\Roaming\Golden Software\Grapher\13\. The entries are formatted as <Name>=<Full Path to BAS File.bas>. The Name value is displayed in the Automation | User Scripts list. The Full Path to BAS File.bas is the full path to the script file. This can be anywhere on the user's computer.

The Automation | User Scripts list can be shared between computers by copying and pasting the UserTools.ini file from one machine to the other. However the scripts must be located in the same location for the script buttons to work properly.

See Also

Automation Tab Commands

Ribbon