Database Reference
In-Depth Information
▪ You have a series of informational layouts you want to display on a wall-mounted monit-
or (like shop operation information or information for customers standing in line). Using
a timer, you can automatically switch layouts periodically, so your monitor shows each
one for 30 seconds, like a repeating slide show.
▪ Your editing process is time sensitive. For example, say you have lots of people working
in your database, and lots of people have to edit the same record. To keep someone from
keeping a record locked too long (see the box on Record Locking ) , install a timer when
she switches to the edit layout. It can switch back to the read-only layout after a few
minutes in case she walks away from her computer.
▪ You want to set up a computer to run periodic tasks. Maybe you have to import order in-
formation from your company's web server every 10 minutes, or you want to send ship-
ment notifications every hour. You can install FileMaker on a computer, and schedule a
timer to run the appropriate scripts periodically, with no intervention from anyone.
You'll see an example of a timer in action in the next section.
Keystroke Triggers
The keystroke trigger is probably the most complex FileMaker scripting technique. The basic
concept is simple, though: A script runs every time any key is pressed. It's the scripting part
that's complicated, since the script needs to test for all the keystrokes you want to intercept
and then take action when they're pressed. Keystroke triggers can apply to the layout, or to a
specific layout object .
You might use an OnLayoutKeystroke trigger to add direct keyboard navigation (for ex-
ample, pressing C to switch to the Contacts tab, or using the arrow keys to switch between
records, and so on). An OnLayoutKeystroke trigger is also useful if you want to cancel key-
strokes layout-wide. For instance, you can prevent the entry of punctuation into any field, or
keep the arrow keys from working. To configure a keystroke trigger for the layout, view the
Triggers tab of the Layout Setup dialog box (Layouts→Layout Setup). Select the OnLay-
outKeystroke option and then select the script that should run.
Most often, you apply the OnObjectKeystroke trigger to fields, where you can limit which
keys your users can press, jump to the next field when they press the space bar, or some other
specialized field-type action. To use an object keystroke trigger, select a layout object and
then choose Format→Set Script Triggers. Select the OnObjectKeystroke trigger and then
select the script that should run. This time, the trigger fires only if the object has keyboard
focus when the key is pressed.
Search WWH ::




Custom Search