Tutorial

Table Of Contents
42 FileMaker Pro Tutorial
Perform a series of tasks using a script
As you have just seen, you can use a button to perform a single command.
To make FileMaker Pro perform a sequence of commands, use a script.
About scripts
A script lets you construct a series of instructions for FileMaker Pro
to perform. Like buttons, scripts allow you to automate most of the
FileMaker Pro menu commands, as well as activate some commands
not found in the FileMaker Pro menu structure. Simple scripts can
perform a single task, while complex scripts might combine
elements (such as user feedback and control) with programming
techniques (such as branching and looping) to make powerful,
dynamic instruction sets.
Create a script to preview the Labels layout
1. Choose Scripts menu > ScriptMaker
TM
.
2. Click to create a new script.
3. In the Script Name text box, type Preview Labels Layout.
4. Select the Go to Layout script step and click the Move button. (You
can also select and move script steps by double-clicking them.)
5. In the Script Step Options area, select the Labels layout in Specify.
6. From the list on the left, scroll down and select the Enter Preview
Mode script step, and move it over to your script.
7. Close the Edit Script dialog box, click Save, then close Manage
Scripts dialog box.
8. To run the script you have just created, choose Scripts menu >
Preview Labels Layout. FileMaker Pro displays the Labels layout and
switches to Preview mode.
Assign a script to a button
While buttons are generally more convenient for users, scripts are a
more powerful feature, allowing you to combine many menu
commands into a single executable action. Using a button to run a
script gives you the best of both features.
To assign the script you just created to the button you created earlier:
1. Choose Data Entry from the Layout pop-up menu.
2. Choose View menu > Layout Mode.
3. Double-click the button you created earlier in this lesson.
4. In the Button Setup dialog box, select the Perform Script script step
near the top of the list on the left.
5. In the Options area, for Current Script click Specify. Select Preview
Labels Layout from the list of available scripts, and click OK. Leave the
rest of the default button settings as they are and click OK.
The finished
script