Importing and Exporting in a Script

Like almost everything else in FileMaker, you can completely control the import and export process from a script. You use the Import Records and Export Records script, which you can find in the Records section of the script steps list. You also find script steps for Save Records as Excel and Save Records as PDF, with similar options.

17.5.1. The Import Records Script Step

This script step has three options. First, you get to specify the data source to import from. Your choices match those in the File Import Records menu: File, Folder, Digital Camera (Mac OS X only), XML Data, and ODBC Data. Whichever option you choose, FileMaker asks you for more information (which ODBC data source to use, for instance). When specifying a file, you get the standard path list dialog box. In other words, you can specify several paths if you want; FileMaker imports the first one it finds. (If you don't specify a source, your users have to do it as they run the script, in a potentially confusing series of dialog boxes. Since you're presumably providing a script to make things easier for people, it's best to store source files in a safe place and have the script escort your users to them.)

Once you've specified the source, you can turn on "Specify import order" to record the import field mapping, and other import options. Finally, you can turn on "Perform without dialog" if you want FileMaker to import the data directly, with no input from your users. If you leave this option off, FileMaker displays the Import Field Mapping dialog box when the script runs, so folks can make changes to any field mapping you specified.

17.5.2. The Export Records Script Step

The Export Records script step offers similar options. You can specify the output file and export order, and you can choose "Perform without dialog" if you don't want your users to see the export dialog box.

When you specify the output file, you may be surprised to see an Output File Path List. In other words, FileMaker lets you specify more than one file. This choice doesn't mean FileMaker exports more than one file, though. Instead, it exports to the first file path that is valid. If the first path in the list includes a folder name that doesn't exist, for example, FileMaker skips it and tries the next one.

Part I: Introduction to FileMaker Pro

Your First Database

Organizing and Editing Records

Building a New Database

Part II: Layout Basics

Layout Basics

Creating Layouts

Advanced Layouts and Reports

Part III: Multiple Tables and Relationships

Multiple Tables and Relationships

Advanced Relationship Techniques

Part IV: Calculations

Introduction to Calculations

Calculations and Data Types

Advanced Calculations

Extending Calculations

Part V: Scripting

Scripting Basics

Script Steps

Advanced Scripting

Part VI: Security and Integration

Security

Exporting and Importing

Sharing Your Database

Developer Utilities

Part VII: Appendixes

Appendix A. Getting Help



FileMaker Pro 8. The Missing Manual
FileMaker Pro 8: The Missing Manual
ISBN: 0596005792
EAN: 2147483647
Year: 2004
Pages: 176

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