Database Reference
In-Depth Information
UP TO SPEED: PAUSING A SCRIPT
Normally when you run a script, FileMaker performs its steps one by one as fast as it can. When
they're all finished, the script is done. But sometimes a script should pause, usually to wait for
someone to do something (like enter Find criteria) or to show the user something (like a Preview
mode for a report). The Pause/Resume Script step, and some other steps (like Enter Find Mode )
can pause the script automatically when their Pause options are turned on. When FileMaker gets to a
step like this, it stops executing the script but remembers where it left off. Later, the script continues,
starting with the next step in line. While a script is paused, you're free to edit records, switch modes,
change layouts, and so forth. You can't open the Manage Database, Manage Value Lists, Manage
Custom Functions, or Manage Scripts windows, though, until the script finishes running.
While a script is paused, FileMaker adds two new buttons to the Status toolbar. The Continue button
causes the script to continue immediately (pressing the Enter key does the same thing). The Cancel
button tells FileMaker you don't want to run the rest of the script. Your script stops, and you get
back full control of the program.
If you want to, you can tell FileMaker how long to pause by clicking the Script Step Options area's
Specify button when the Pause/Resume Script step is selected. The dialog box that appears has
two choices: Indefinitely and For Duration. If you choose For Duration, you get to enter the number
of seconds you want the script to pause, or you can click another Specify button to use a calculation
to set the number of seconds. If you have set the script to pause for a specific duration, then you can
still do things with your database while the script is paused, including clicking the Continue or
Cancel buttons.
With a name like Pause/Resume Script you'd think this step could also resume a paused script.
But then again, if the script is paused, then how can the step possibly execute? Don't be fooled: This
step can only pause.
Static Find Requests
With the script you created on the previous few pages, people can search for customers by
entering find requests. More often than not, you don't want to make people enter the find re-
quests manually. After all, the whole point of a script is to have FileMaker do things so
people don't have to. If you know ahead of time exactly what you want the script to find, use
the Perform Find step all by itself: Just turn on the “Specify find requests” option and cre-
ate the settings for the request; the search options stay the same each time the script runs.
When you specify find requests in a script, you see a pair of windows that let you set up a
scripted request.
When you turn on the option Specify Find Requests or click the Specify button for the Per-
form Find script step, you see the Specify Find Requests window ( Figure 12-13 ). Click
New and you'll see the Edit Find Request window ( Figure 12-14 ). To edit an existing re-
Search WWH ::




Custom Search