Go to Contents
Previous
Page
Next
Page
Contents > Using FileMaker Pro Advanced tools > Debugging scripts (FileMaker Pro Advanced)

Debugging scripts (FileMaker Pro Advanced)
The Script Debugger is an interactive tool for troubleshooting your FileMaker scripts.
With the Script Debugger, you can:
debug startup scripts (the Script Debugger menu is enabled even if there are no open files)
step into a sub-script to execute it one step at a time, or step out of a sub-script
set or clear breakpoints in your script
begin debugging from any script steps within the script
view sub-scripts as you step through scripts
debug restricted-access scripts
pause a script when script errors are encountered
click a script error number to open a Help topic
monitor fields, variables, and calculations
disable script steps
To debug scripts:
1. To enable the Script Debugger, choose Tools menu > Script Debugger.
2. Run your script.
3. Choose from the following options:
Choose To
Step
Step
Execute the script one step at a time.
If the script step is Perform Script, the Script Debugger will execute the sub-script and proceed to the next line of the calling script. The Script Debugger will execute all sub-script steps until it encounters a breakpoint.
Step Into
Step Into
Execute the script one step at a time.
If the script step is Perform Script, the Script Debugger will step to the first line of the sub-script and await user input before proceeding to the next sub-script step.
Step Out
Step Out
Execute all script steps in the current script and, if the script is a sub-script, return to the line after the Perform Script step in the calling script.
If the script is not a sub-script, the Step Out command will cause the Script Debugger to execute all script and sub-script steps until it encounters a breakpoint.
Set Next Step
Set Next Step
Set the step execution pointer to the highlighted script step.
This command passes control to the highlighted step but does not perform the step. The highlighted step is performed when script execution is resumed. Any script steps between the last executed step and the assigned next step are not executed. Click a step to highlight it, then click Set Next Step.
Run/Pause
Run/Pause
Toggle between executing all script steps until a breakpoint is encountered and pausing. When a script is paused, you can double-click the script in the Active Scripts list to edit it. Each active script opens in a separate Edit Script dialog box, so you can edit multiple scripts. The scripts are not halted until you save them.
You can step through a script using the Step script button when a script is paused.
Halt Script
Halt Script
Halt execution of a script and close Script Debugger.
Set/Clear Breakpoint
Set/Clear Breakpoint
Set or clear a breakpoint from the selected line.
Breakpoints can be set or cleared from the Script Debugger or from ScriptMaker. Breakpoints are saved with the file that contains the script. Breakpoints are ignored by FileMaker Pro and when the Script Debugger is not in use. Breakpoints allow the Script Debugger to perform large sections of the script that do not need to be looked at closely. You can set breakpoints on multiple steps. However, this disables Set Next Step.
Edit Script
Edit Script
Open the Edit Script dialog box to edit the current script.
Open/Close Data Viewer
Open/Close Data Viewer
Open (or close) the Data Viewer window so you can monitor specified fields, variables, and calculation formulas. See Using the Data Viewer (FileMaker Pro Advanced).
Authenticate/Deauthenticate script
Authenticate script Deauthenticate script
Unlock scripts for which you do not have Modifiable privileges.
You must have Full Access privileges to authenticate a script. The higher level of privileges applies to all scripts, but not to other file elements (for example, records and layouts). Your editing privileges last until you close Script Debugger or the Data Viewer.
4. Select Pause on error if you want scripts to pause when errors are encountered.
For Last error, click the error number to open a Help topic with details about the error. See FileMaker Pro error codes.
Viewing sub-scripts
You can view sub-scripts when you step through scripts in the Script Debugger. For example, if Script A calls Script B, which then calls Script C, you can view the steps in all three scripts.
1. Choose Tools menu > Script Debugger.
To open the Script Debugger from the Manage Scripts dialog box, select a script, press Shift and click the Perform button. To close the Script Debugger, press Ctrl (Windows) or Command (Mac OS) and click the Perform button. For more information on keyboard shortcuts, see FileMaker Pro Advanced keyboard shortcuts (Windows) and FileMaker Pro Advanced keyboard shortcuts (Mac OS).
2. Select a script step that calls a sub-script.
3. Click the Step Into button.
The Active Scripts list displays the sub-script.
4. Select a script in the Active Scripts list to view that script's steps in the display area.
Notes
Set Next Step is only available for the currently executing script.
In order to facilitate proper script debugging, the Script Debugger overrides some script steps. The Allow User Abort script step with the option set to off will not prevent you from stopping the execution of a script. The Adjust Window script step with the options of hide or minimize will not hide or minimize the window when encountered through the Step or Step Into buttons.
If a script with access privileges set to Modifiable performs a script with Executable Only access, the Executable Only script will perform in its entirety without showing its steps in the Script Debugger. If an Executable Only script performs a script with privileges set to Modifiable, only the steps in the Modifiable script will appear in the Script Debugger. To edit a script, choose the Authenticate/Deauthenticate Script button. For more information about script privileges and running scripts with full access, see Editing scripts privileges.
If you open the Data Viewer after choosing Authenticate/Deauthenticate Script, your access privileges are maintained in both the Data Viewer and Script Debugger until you close the Script Debugger.
You can open one Edit Script dialog box per script.
You can debug a startup script by opening the Script Debugger before opening your database file.
When you close the Script Debugger while a script is paused, the script resumes and completes.
FileMaker Pro Advanced may not be available in all of the shipping languages of FileMaker Pro.
Related topics
Creating and editing scripts using ScriptMaker
Disabling script steps (FileMaker Pro Advanced)
Using the Data Viewer (FileMaker Pro Advanced)

Contents > Using FileMaker Pro Advanced tools > Debugging scripts (FileMaker Pro Advanced)
Previous
Page
Next
Page