Chapter 17. Advanced Scripting
Being familiar with FileMaker’s lengthy list of script steps is a great foundation, but putting together a workable script takes practice. Although some scripts are simple affairs, many scripts require forethought, planning, and organization. FileMaker gives you tools to help you write scripts and troubleshoot them when they aren’t working. Plus, you can organize and document your work as you go. In this chapter, you’ll pull these concepts together to learn how to write and manage complex scripts.
Download this chapter’s sample file from this book’s Missing CD page at www.missingmanuals.com/cds/fmp13tmm. Use Invoices_START.fmp12 to work in and use Invoices_FINISHED.fmp12 to see the completed examples.
When you look at a script someone else created—or you created a long time ago—you can’t always tell what the script does. To help keep things clear, add comments to your script. You add each comment by using a
Comment script step. This step has just one option: the text of the comment itself. The
Comment step is special for two reasons. First, it doesn’t do anything. Second, it appears in bold when you view your script in the Edit Script window.
Use comments to document anything important about the script. Here are some things you may want to include in a comment or set of comments:
What the script does
Who wrote the script
The date the script was written
The date, if any, the script was last edited
Who edited the script
Anything special ...