Script options

Use the Scripts tab to specify the default script language and any autoscripts you want to use. You can use scripts to automate many functions, including customizing pivot tables.

Note: Legacy Sax Basic users must manually convert any custom autoscripts. The autoscripts installed with pre-16.0 versions are available as a set of separate script files located in the Samples subdirectory of the directory where IBM® SPSS® Statistics is installed. By default, no output items are associated with autoscripts. You must manually associate all autoscripts with the output items, as described below. For information on converting legacy autoscripts, see Compatibility with Versions Prior to 16.0.

Default script language. The default script language determines the script editor that is launched when new scripts are created. It also specifies the default language whose executable will be used to run autoscripts. The available scripting languages depend on your platform. For Windows, the available scripting languages are Basic, which is installed with the Core system, and the Python programming language. For all other platforms, scripting is available with the Python programming language. For the Python programming language, you can choose Python 2 or Python 3 as the default script language.

To use scripting with the Python programming language, you need IBM SPSS Statistics - Essentials for Python, which is installed by default with your IBM SPSS Statistics product.

Enable Autoscripting. This check box allows you to enable or disable autoscripting. By default, autoscripting is enabled.

Base Autoscript. An optional script that is applied to all new Viewer objects before any other autoscripts are applied. Specify the script file to be used as the base autoscript as well as the language whose executable will be used to run the script.

To Apply Autoscripts to Output Items

  1. In the Command Identifiers grid, select a command that generates output items to which autoscripts will be applied.

    The Objects column, in the Objects and Scripts grid, displays a list of the objects associated with the selected command. The Script column displays any existing script for the selected command.

  2. Specify a script for any of the items shown in the Objects column. click the corresponding Script cell. Enter the path to the script or click the ellipsis (...) button to browse for the script.
  3. Specify the language whose executable will be used to run the script. Note: The selected language is not affected by changing the default script language.
  4. Click Apply or OK.

To remove autoscript associations

  1. In the Objects and Scripts grid, click the cell in the Script column corresponding to the script to dissociate.
  2. Delete the path to the script and then click any other cell in the Objects and Scripts grid.
  3. Click Apply or OK.

To set script options

From the menus, choose:

Edit > Options

  1. Click the Scripts tab.
  2. Select the settings you want.
  3. Click Apply or OK.