An autoscript is a script procedure which runs automatically when it is triggered
by the creation of a specific piece of output by a given SPSS procedure.
Therefore any SPSS procedure may have a number of autoscripts: every piece of
output generated by an SPSS procedure (a pivot table, a text object or a graph)
can have its own autoscript.
Autoscripts procedure code is placed in the Autoscript.sbs
(by default) autoscript file, located in the Scripts folder within the
SPSS installation folder.
It is possible to change the name and location of the script file by looking in the
Scripts tab of the Options dialog box (Edit menu). There, it is also possible to
enable or disable individual autoscripts.
It is easy to add a new autoscript: simply, select in the output navigator
the object item you want to create the autoscript code, then right-click or use the
Utilities menu to select the Create/Edit Autoscript menu item.
A new script window containing the active autoscript file will appear, and a new
subroutine referring to the output object's autoscript will be added to the file.
There you can add your code that will be executed every time that particular
output object has been created.
The Autoscript.Sbs file contains an header specifying the name of autoscript subroutines and whether these are enabled or not.
This header is made of comment lines (lines that start with a comma): these lines
are not executed by the Sax basic engine, but they are used by SPSS.
The Autoscript subroutines specification is enclosed within the
HeaderBegin - HeaderEnd
comment lines.
Within them there is the list of subroutine names that make up the autoscript library.
Each element of this list is put in a single line, and is composed with the
enabled or the
disaabled keyword, followed by the autoscript
subroutine name.
In practice, an autoscript file header is similar to the following:
' HeaderBegin ' disabled Frequencies_Table_Frequencies_Create ' enabled Crosstabs_Table_Crosstabulation_Create ' disabled Summarize_Table_Report_Create ' HeaderEnd