User manual

Table Of Contents
Creating scripts to automate tasks
10-11
Importing scripts
FileMaker Pro allows you to import scripts from other
FileMaker Pro databases.
Many scripts reference fields (local and related), layouts, records,
and other scripts (local and in external files). In addition, some script
steps, such as Set Field, Insert Calculated Result, Replace, etc., may
have field references embedded in calculations. While these
references may be valid in the original file, it is possible that they will
be invalid in the file into which they are being imported.
To minimize the loss of information, FileMaker Pro attempts to map
field, relationships, scripts, and layout references based on their
names. Fields, relationships, scripts and layouts that cannot be
mapped are marked as unknown, and should be edited and corrected
before the script is performed.
When you import a script, you might need to edit the script to make
sure that all references are valid and appear as intended. Always
review your imported script prior to performing it for the first time.
To import a script
1. Open the file into which the script will be imported.
2. Choose Scripts menu > ScriptMaker.
3. Click the Import button.
4. Open the file that contains the script(s) you want to import.
5. In the Import Scripts dialog box, place a check mark next to the
script(s) you want to import.
6. Click OK, then click OK again.
Keep these points in mind:
1 During script import, the match for field and layout names is case
sensitive. If no match can be found, the word <unknown> will appear
in place of the missing field and/or layout name.
1 When importing a script that references a relationship,
FileMaker Pro assumes that
1 the names of the relationships are the same
1 the keys of the relationships are the same
1 the base fields’ names, types and keys are the same
If all of these conditions are not met, the unmatched items will have
the word <unknown> appended to them within the script.
1 When importing script steps that contain calculations (for
example, If, Set Field, and Insert Calculated Result), FileMaker Pro
matches field name and field type. If a match is not found, the word
<unknown> will appear in place of the missing field.
1 Information stored in scripts (for example, Find requests, Sort
order, Import field order, and Export field order) will attempt to be
mapped to original fields using the above rules. If no original
matching field can be found, the unmapped fields will be replaced
with the word <unknown>.
1 When importing scripts that contain the Perform Script step, the
link between scripts will be retained only if the linked scripts are
imported at the same time. If a script with the same name is already
present in the target file, no attempt will be made to link between the
two scripts. If the Perform Script step references an external script,
the imported script will also reference the external script.
Listing scripts in the Scripts menu
FileMaker Pro lists scripts in the Script menu and assigns keyboard
shortcuts, like Ctrl+1 (Windows) or Command+1 (Mac OS), to the
first ten scripts.
To change the order of scripts in the Scripts menu:
1. Choose Scripts menu > ScriptMaker.
2. In the Define Scripts dialog box, drag the double arrow to the left
of the script name to a new position.