Database Reference
In-Depth Information
switch to the Invoices layout would ensure the right layout, but not necessarily the right
invoice . It's best if this script runs only when someone's already open to the Invoices
layout—presumably looking at the invoice she wants to refund.
NOTE
When a script can do damage to your database if it's run from the wrong layout, use the fail-safe of
the third option even if you're the only person who uses your database. If your mouse hand slips and
runs the script because you're insufficiently caffeinated, then the script can show you an error mes-
sage rather than running in the wrong context.
Running Scripts
You're probably starting to see how scripts can be really useful in your database. But so far,
the main way you've seen to run a script is pretty tedious: Choose Scripts→Manage Scripts,
select the script and then click Perform. That's lots of clicks to run a script that's supposed to
save you time. There are other ways to run scripts, including from the Scripts menu, by
clicking a custom button or using a script trigger. You can even choose the best method for
running each script.
The Scripts Menu
You can show some or all of your scripts in the Scripts menu. If you have a script (or two) to
which you want quick access from anywhere , then it makes sense to put it in the Scripts
menu. That way, anyone can run it by simply choosing it from the menu. FileMaker even has
keyboard shortcuts for the first 10 scripts in the Scripts menu: Ctrl+1 ( -1) through Ctrl+9
( -9) for the first nine, and Ctrl+0 ( -0) for number 10. Figure 11-11 shows how to assign a
script to this menu in the Manage Scripts window.
NOTE
If 10 scripts in a list isn't your idea of a highly organized command center, take heart. In Chapter 13 ,
you'll learn how to completely customize the menus in your database. You can add a new command
to any menu, name it whatever you want, assign a keyboard shortcut and then have it run a script.
You can remove the menus you don't want, or add new menus.
Search WWH ::




Custom Search