Combining Sub-Scripts
In "To create a sub-script to find records," we created several sub-scripts. Because they're small and modular, we can swap them in and out to create customized master scripts that do essentially the same things for a wide variety of different criteria. For this example we'll create a script that combines a find sub-script and a sort sub-script, then prints the result.
To create a master script
1 .Choose Scripts > ScriptMaker (Control+Shift+S/Command+Shift+S).2 .When the Define Scripts dialog box appears, click New.3 .When the Edit Script dialog box appears, type Print Sales Report in the Script Name box.4 .In the step list on the left, scroll down to the Navigation section and double-click Go to Layout.5 .In the Script Step Options section, choose your report layout from the Specify drop-down menu (Figure 7.29). In our example, we use Sales Report.
Figure 7.29. Specify a layout in the Go to Layout script step.
[View full size image]

Figure 7.30. You can set the print options for a specific printer as part of your script.

Figure 7.31. Choose the script to perform from the "Specify Script" Options menu.

Figure 7.32. The sort script must be run after the find script.

Figure 7.33. If the "Perform without dialog" check box is unchecked, the report will print to the current printer after prompting the user.

Figure 7.34. Since this script is only going to be used as a sub-script, it doesn't need to appear in the Scripts menu.

