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 Change font for all objects, Create color scale for class legend, Create scatter plot matrix, Save and Export, and Print All Open Documents sample scripts are included in the Automation | 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.

Change font for all objects

This automation script is designed to change the font face and/or size for all objects in your project. It's important to be aware of two exceptions where this change will not occur: firstly, any text located inside Magnifier objects, and secondly, any objects that are members of more than one level of nested Groups.

Create colorscale for classes

This automation script will generate a continuous color scale for any classed type plot in your project by creating a rectangle using the same gradient as the class gradient and text for labels based on the classes. Please note that this script is designed to work with the predefined gradients that are installed with the software and will not function with custom gradients.

Create scatter plot matrix

This automation is designed to create a scatter plot matrix from your data. It will prompt you to select a worksheet and configure some other settings to create a resulting graph.

Save and export

This automation script will save the currently open file and then export it using the same file name.

Print all open documents

This automation script will automatically print all plot documents you currently have open in Grapher. Worksheets and grids will not be printed by this script.

See Also

Automation Tab Commands

Ribbon