Creating and editing scriptsAfter you have planned your scripts, you are ready to create, edit, and manage them.
1. You can also choose Empty Script or Default Script from the New list. If you choose Default Script, FileMaker Pro includes default script steps that you can edit or delete in the Edit Script window.
Type a name for the new script in the Script Name text box. Select it from the list of available steps and click Move. Typing the first few letters of the script step scrolls the list to that script step. A step with square brackets after it has options you can set. Double-click the step, or select it and click Specify. In the next dialog box, specify options, and click OK. Select it in the list on the right and click Duplicate. Select it in the list on the right, then choose Edit menu > Copy. Click in the list where you want the script step to appear, and choose Edit menu > Paste. You can also copy and paste script steps into other scripts, copy and paste scripts, or copy and paste into other files. See Copying and pasting scripts. Choose an option from the Show Compatibility list:
• All displays all script steps.
• Macintosh displays all script steps supported in FileMaker Pro for OS X.
• Windows displays all script steps supported in FileMaker Pro for Windows.
• Server dims script steps that are not supported in a FileMaker Server schedule.This option refers to scripts running in a FileMaker Server schedule. When a FileMaker Pro or FileMaker Go client runs a script in a database that is hosted by FileMaker Server, the script steps are run on the client. The steps that are compatible with Macintosh, Windows, or iOS are executed.
• iOS dims script steps that are not supported in FileMaker Go.
• Custom Web Publishing dims script steps that are not supported in Custom Web Publishing.
• FileMaker WebDirect dims script steps that are not supported in FileMaker WebDirect. Select Run script with full access privileges. See the Note below for additional information.
•
• For information on each script step and its options, see Script steps reference (alphabetical list) and Script steps reference (category list).
4. When you are finished, close the Edit Script window, then click Save to save it. Or choose File menu > Save Script (Windows) in the Edit Script window, or choose Scripts menu > Save Script (OS X) in the FileMaker Pro menu bar.
6.
•
• Add comments to your scripts with the Comment script step. Using comments in your script helps others who might want to look at or modify it.
• To build scripts quickly, duplicate (or copy and paste) an existing script that does something similar to what you want to do and modify the copy. To create a duplicate script with the same name as the original, select it in the list and press Shift+Duplicate in the Edit Script window. (Or, in the Manage Scripts dialog box, press Shift as you click .)
•
1.
2. In the Manage Scripts dialog box, select the script you want to change, then click Edit or double-click the script name.Tip You can open multiple Edit Script windows at the same time. In the Manage Scripts dialog box, use Ctrl-click (Windows) or Command-click (OS X) to select non-contiguous scripts, or Shift-click to select contiguous scripts, then click Edit. A separate Edit Script window opens for each script. Double-clicking with multiple scripts selected only opens the script that you clicked. To close all windows, press Alt (Windows) or Option (OS X) and click the close button in any window.
4. To perform your script, select it in the Manage Scripts dialog box and click Perform. Make any changes to your script as needed.
• You can also create, edit, duplicate, and delete scripts from the Specify Script dialog box when you create a button or script trigger.
• Use Run script with full access privileges to enable a script to run with the full access privilege set, even if the current user has logged in with a privilege set that does not have full access. Using this feature enables users with limited access and privileges to perform scripted tasks that they would otherwise be unable to execute, such as exporting or deleting records. Access privileges do not change, but the script can do more privileged work for them. Furthermore, full access does not carry over to any subsequent sub-script, unless this feature has been enabled in that script as well.
• The Run script with full access privileges feature can only be enabled or modified by users with full access privileges. Therefore, only users with full access privileges can edit or delete scripts for which this feature has been enabled.
• The Run script with full access privileges feature only functions in the file in which the script is defined. This command will not override access restrictions on external files. For example, a script to delete records in File A that has the Run script with full access privileges option enabled will not delete records in an access-restricted external file File B.
• If you are using FileMaker Pro Advanced, you can disable script steps for testing. To disable a script step, select it, then click Disable. To enable a script step, select it, then click Enable. Disabled script steps are preceded by “//”. See Disabling script steps (FileMaker Pro Advanced).
• If a script step specifies a field in a tab panel or slide panel that is not the front-most panel, the specified field is selected and the panel it is in moves to the front of the panel control. If, however, the same field appears elsewhere on the layout and the script finds that field first, the panel with that same field will not come forward. Instead, assign an object name to the field and use the Go to Object script step to move to that instance of the field.
• If a script step specifies a field in a popover, the popover opens and the field is selected. If the same field appears elsewhere on the layout and the script finds that field first, the popover with that same field will not come forward. Instead, assign an object name to the field and use the Go to Object script step to move to that instance of the field.