Other Script Steps
You've now seen most of the often-used script steps (and a few of the not-so-often used ones). You'll see even more as they come up in the next few chapters. The rest of this chapter covers a few oddball steps that don't seem to fit in anywhere:
14.9.1. Open URL
You first saw the Open URL script step as a button command when learning about text calculations. When FileMaker runs this step, it asks the your computer's operating system to open the URL you specify. Most often the URL is a web address (HTTP), but it can be any URL type your computer supports, including FTP, MAILTO, SSH, and even FMP7 (to open a file on a network server). As usual, you can specify the URL or let the user do it, and you can use a calculation if needed.
14.9.2. Dial Phone
The Dial Phone script step tells your modem to dial the telephone using a phone number you provide. You can use a calculation to specify the phone number or enter it directly.
Note: This script step doesn't work on Mac OS X.
14.9.3. Send Email
If you have an email program set up on your computer, FileMaker can use it to send email from a script. The Send Email script step has two options, the standard "Perform without dialog" checkbox and a Specify button. Clicking Specify shows the Send Mail Options window in Figure 14-17.
|
Although you probably wouldn't guess it, you can use a calculation for each of the values in the Specify Mail dialog box. The little button to the right of each entry box shows a menu when clicked with two choices:
- Specify Field Name.
- Specify Calculation.
Whatever you specify for the To, CC, and BCC values, you can also select the associated "Get values from every record in found set" checkbox. When you turn any one of these boxes on, FileMaker creates one outgoing email message for each found record. Each message uses field data specific to one of the records. In this way, you can email all your customers in one shot, addressing each one individually, and including a custom-crafted email message for each.
The "Perform without dialog" option for this script step has an unexpected behavior. Instead of showing the user FileMaker's Specify Mail dialog box when this option is turned off, FileMaker opens her email program, creates the message, and opens it onscreen. The user can then modify the message as needed and send it. If you turn "Perform without dialog" on, FileMaker puts the message directly in your email program's outbox with no user interaction.
14.9.4. Flush Cache to Disk
Any time changes are made to a record, FileMaker records those changes in your computer's memory first, and writes the change to the hard drive laterwhen it gets some free time. If you want to force the changes to be written to disk immediately, you can run the Flush Cache to Disk script step. For instance, you might add this script step after a script that creates a new customer order. That way, if your computer crashes while you're busily taking orders, you lose only the last one you were working on.
14.9.5. Exit Application
Last but not least, you can have a script exit or quit the FileMaker application on your behalf. Of course this causes every open window and file to be closed as well. People usually use this when they have just one database, and they never use FileMaker unless they're in that database. They add the Exit Application step to the very end of their database's closing script so that when they close the last database window FileMaker goes away too. (Of course you find FileMaker so useful you never want to close it, right?)