Chapter 15. Advanced Scripting
Being familiar with FileMaker’s lengthy list of script steps, which you saw in the previous chapters, is a great foundation, but putting together a workable script takes practice. Although some scripts are simple five-line affairs, sometimes a script requires a lot of 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.
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 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. You can see a commented script in Figure 15-1.
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 and why to use it
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 about how or when the script should be run, like whether only some database users can ...