You can use scripts to customize operations within a particular flow, and they're saved with that flow. For example, you might use a script to specify a particular run order for terminal nodes. You use the flow properties page to edit the script that's saved with the current flow.
To access scripting in a flow's properties:
- Right-click your flow's canvas and select Flow properties.
- Open the Scripting section to work with scripts for the current flow.
- By default, the Python scripting language is used. If you'd rather use a scripting language unique to old versions of SPSS Modeler desktop, select Legacy.
- For complete details about scripting, see the Scripting and automation guide.
You can specify whether or not the script runs when the flow runs. To run the script each time the flow runs, respecting the run order of the script, select Run the script. This setting provides automation at the flow level for quicker model building. Or, to ignore the script, you can select the option to only Run all terminal nodes when the flow runs.
The script editor includes the following features that help with script authoring:
- Syntax highlighting; keywords, literal values (such as strings and numbers), and comments are highlighted
- Line numbering
- Block matching; when the cursor is placed by the start of a program block, the corresponding end block is also highlighted
- Suggested auto-completion
A list of suggested syntax completions can be accessed by selecting Auto-Suggest from the context menu, or pressing Ctrl + Space. Use the cursor keys to move up and down the list, then press Enter to insert the selected text. To exit from auto-suggest mode without modifying the existing text, press Esc.