• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Creating Simple Scripts > Combining Sub-scripts

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, and then prints the result.

To create a master script:

1.
Go to the layout you want to use for your report. Choose File > Print Setup (Windows)/Page Setup (Mac).

2.
Set the options for printing this report (Figure 7.29).

Figure 7.29. The Print/Page Setup options must be set before the script is created.


3.
Choose Scripts > ScriptMaker.

4.
When the Define Scripts dialog box appears, type Print Sales Report in the Script Name box and click Create.

5.
The Script Definition dialog box will appear with the default script in the assembly window on the right. Click Clear All to delete the default steps.

6.
In the step listing on the left, scroll down to the Navigation section and double-click Go to Layout.

7.
In the Options section, choose your report layout from the Specify drop-down list (Figure 7.30). In our example, we use Sales Report.

Figure 7.30. Specify a layout in the Go to Layout script step.


8.
Double-click Print Setup/Page Setup in the Sort/Find/Print section. Leave both options boxes checked (Figure 7.31).

Figure 7.31. Restore will use the Print/Page Setup options in use when the script was created.


9.
In the step listing on the left, double-click Perform Script in the Control section to add it to the assembly window.

10.
In the Options section, choose Find Checks from the Specify drop-down list (Figure 7.32).

Figure 7.32. Choose the script to perform from the list in the Specify drop-down list.


11.
Double-click Perform Script again.

12.
In the Options section, choose Sort by Last Name (Figure 7.33).

Figure 7.33. The Sort script must be run after the Find.


13.
In the step listing on the left, scroll to the Sort/Find/Print section and double-click Print. You can choose to have the Print dialog box display by unchecking the Perform without dialog box (Figure 7.34).

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


14.
Click OK to add the script to the Define Scripts listing, then click Done.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint