You can create small sub-scripts that do one or two specialized tasks, then combine them with a more generic larger script to execute a variety of actions. These scripts may only contain one step apiece, but they allow you to retain a variety of settings without having to re-search or re-sort each time you want to create a variation on one script idea. For example, if you frequently have to sort your files by last name, you can preset your database with this sort, then create a sub-script that only has a Sort step in the script. Then you can add this sub-script to any other scriptfor updating accounts payable or analyzing account payment patternsas you need it. We use this strategy to create a search script for payments by check.
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 Find Checks in Script Name.
4 .
Scroll down to the Found Sets category in the left window and double-click Perform Find (Figure 7.22).
5 .In the Script Step Options section, click Specify.
6 .When the Specify Find Requests dialog box appears, click New (Figure 7.23).
7 .When the Edit Find Request dialog box appears, select a table from the "Find records when:" drop-down list.
8 .
Select Payment from the scrolling list of fields (Figure 7.24).
9 .In the Criteria section, type Check, then click Add (Figure 7.25).
The new criteria will appear in the top section of the dialog box.
10 .
Click OK four times to finish. You now have a script that will just find all of the records that were paid by check.
11 .To create scripts for other types of payment, follow these steps but substitute other payment types in the Criteria section. In our example, we created a total of four small scripts sorted for cash, purchase orders, and credit cards as well as check (Figure 7.26).
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 Sort by Last Name in Script Name.
4 .
Scroll down to the Found Sets category in the left window. Double-click Sort to move it to the script-assembly list. Click Specify (Figure 7.27).
5 .When the Sort Records dialog box appears, double-click the Last Name field in the left column (Figure 7.28). Click OK three times to finish.
This creates a small sub-script that will sort data by the Last Name field.
Sub-scripts are a great time-saver when you are still developing your database. You can group all scripts that do a specific joblike scripts that sort or findto locate them easily.