Scripts in FileMaker Pro

 <  Day Day Up  >  

Scripts are sets of stored instructions that specify a series of actions FileMaker should perform when they're initiated; they're programs that run within FileMaker Pro solutions. They can be just one command attached to a button, or they can be hundreds of commands long.

Scripts do two important things in FileMaker Pro: They automate internal processes, and they are used to add interactivity to custom user interfaces. Internal functions are often critical and specific, used for such things as a monthly run at creating invoices, setting the status of sales leads, exporting data for an aggregated report, and so on. Central to making a database application usable is the ability to create interface elements (such as buttons or icons) and then have them do something in response to user actions. Scripts can help with both of these.

Scripts are written in FileMaker Pro's ScriptMaker, a point-and-click interface. They allow routines to perform tasks ranging from simple things (such as beeping at the press of a button) to complex automated import/export processes, multi-table reporting, data reconciliation, and really anything that can be expressed as a programmed series of FileMaker steps.

NOTE

If you're new to FileMaker Pro, we suggest you read this chapter from start to finish because we will be covering some important fundamentals. If you're familiar with previous versions of FileMaker Pro, we suggest you take a look at the discussion of access privileges and skim the functions section for those you might not be familiar with. We'll be covering some new script steps.


After a script is initiated through some user action or external prompt (we'll cover how scripts get initiated later in the chapter), it runs in sequence from its first step to the last, exiting or ending after it is complete. Here's a simple example:

 

 Show All Records Go to Record/Request/Page [ First ] Beep Show Custom Dialog [ Title: "First Record"; Message: "This is your first record."; Buttons: "OK" ] 

As you can see from this short example, FileMaker Pro scripts are very easy to read and comprehend. This script resets the found set of the current layout/window to all the records in a given table, takes the user to the first record in that set, beeps, and shows a dialog with an OK button. Each step of the script is executed in order: Show All Records is completed, and then Go to Record/Request/Page is dealt with.

It's possible to create branching scripts by using logical If[] statements, and it's also possible to construct scripts that execute other scripts (hereafter referred to as subscripts ). We'll get into both such techniques later in the chapter.

 <  Day Day Up  >  


QUE CORPORATION - Using Filemaker pro X
QUE CORPORATION - Using Filemaker pro X
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 494

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net