• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 7. Creating Simple Scripts > Using Sub-scripts for Multiple Export Sett...

Using Sub-scripts for Multiple Export Settings

In Chapter 5, we showed you how to export data to a spreadsheet or accounting program. You can use the sub-script strategy in “To create a sub-script to find records” to create sub-scripts for different export settings. In this example, we create the sub-script that holds one export pre-set.

To create sub-scripts for multiple export settings:

Choose File > Export Records.

When the Export Records to File dialog box appears, type a name for the export file, choose a file format from the drop-down list and click Save (Figure 7.43).

Figure 7.43. Choose a file format and specify a name for the export file.

The name you choose in this step isn't important, because you can choose a different one in the script itself. You must name the file something, however, or FileMaker won't let you proceed!

When the Specify Field Order for Export dialog box appears, double-click the fields in the left window that you want to export to the new file (Figure 7.44).

Figure 7.44. Choose the fields to be included in the export.

Click Export to create the file on your disk. You've now created the pre-sets you'll need for your export script.

Choose Scripts > ScriptMaker.

When the Define Scripts dialog box appears, type a name in the Script Name box and click Create.

The Script Definition dialog box will appear with the default script in the assembly window on the right. Click Clear All to delete the default steps.

In the step listing on the left, scroll down to the Records category and double-click Export Records (Figure 7.45). Leave “Restore export order” checked to retain the settings you created in steps 2 and 3.

Figure 7.45. Check Restore export order to use the same fields in the same order as the last export.

In Options, check the Specify box to choose a file name that will be used for the export file (Figure 7.46a).

Figure 7.46a. If you check Specify, you can set a file name that will be used every time the export script runs.

When the Export Records to File dialog box appears, specify a file name for your export file. Click Save.

If you don't specify a file name, you'll be prompted for one when the script runs, even if “Perform without dialog” is checked.

The script step will display the name and file type of the export file. Click OK to finish.

You can repeat these steps to create new exports and their associated scripts.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint