There are many times, particularly with asset management databases, when it is particularly useful to export the graphic stored in a single field. You can cut and paste, of course, but that's awfully cumbersome if you want more than one field's contents. With FileMaker 7 comes a feature that allows you to export the current record to an external file with a single command. Embed this command in a script, and you can find a group of graphics that meet specific criteria, and export them to individual files.
1 .In the table containing the container field, go to a layout with the field to be exported.
2 .Click on the container field to select it (Figure 11.61).
3 .
Choose Edit > Export Field Contents.
4 .In the Export Field to File dialog box, specify a file name and destination folder (Figure 11.62). Click Save.
1 .
Choose Scripts > ScriptMaker (Control+Shift+S/ Command+Shift+S).
2 .
In the Define Scripts dialog box, click New. When the Edit Script dialog box appears, name the new script (we use Field Export).
3 .In the Navigation section of the script step list on the left, double-click Go to Layout.
4 .
In the Script Step Options section, select a layout that contains the field whose records you want to export to separate files (Figure 11.63).
5 .
Scroll down to the Found Sets section in the script step list, and double-click Perform Find.
6 .In the Script Step Options section, check Specify find requests (Figure 11.64). When the Specify Find Requests dialog box appears, click New.
7 .When the Edit Find Request dialog box appears, select the field you'll use to set your criteria from the "Find records when:" scrolling list.
8 .
Type the criteria for your selection in the Criteria section. In our example, we've set the Find criteria to be when the Artist is Cynthia Baron (Figure 11.65). Click Add, then OK twice.
9 .
Scroll up to the Control section in the script step list, and double-click Loop (Figure 11.66).
10 .
While Loop is highlighted in the script-assembly list on the right, double-click If in the script step list on the left (Figure 11.67).
11 .In the Script Step Options section, click Specify. When the Specify Calculation dialog box appears, type not, followed by a space (Figure 11.68).
12 .From the scrolling function list on the right, double-click IsEmpty.
13 .
With the field variable highlighted, double-click to select the field that contains your graphicsin our case, Image. Click OK to return to the Edit Script dialog box (Figure 11.69).
14 .Scroll down to the Fields section in the script step list. Double-click Export Field Contents (Figure 11.70).
15 .In the Script Step Options section, check "Specify target field."
16 .When the Specify Field dialog box appears, select the same field you chose in step 13, then click OK. Leave "Specify output file" unchecked (Figure 11.71).
If you specify an output file, each time a new record is found, it will replace the previous record that was exported.
17 .
Scroll up to the Navigation section of the script step list. Double-click Go to Record/Request Page.
18 .In the Script Step Options section, select Next from the Specify drop-down list. Check the "Exit after last" check box (Figure 11.72).
Selecting Next tells FileMaker to go to the next record in the found set.
19 .Click OK twice to finish.
When this script runs, it will go to a specific layout, find records that meet your criteria, and export all these records to separate files. The script will end when it finishes exporting the last record in the found set.